2013-03-27 71 views
0

如果您在谷歌瀏覽器中打開以下網址,您會看到問題,首次載入時可以,但如果您不斷刷新頂部3項的寬度(Bedingungen, Preise和所以geht的)崩潰。在Firefox中沒關係,但我不知道它爲什麼在Chrome中做到這一點,任何人看到它爲什麼會發生或有解決方案?謝謝!Chrome使用動態內容摺疊內聯元素的寬度

文本使用Ajax/json加載,它們是內聯的,因爲我希望它們是文本的寬度。我不想設定一個固定的寬度。

http://alexanderlloyd.info/test/

CODE

CSS: 

#game-nav li a { 
    background: none repeat scroll 0 0 rgb(255, 255, 255); 
    border: 1px solid rgb(217, 195, 169); 
    color: rgb(34, 34, 34); 
    display: inline-block; 
    padding: 8px 12px 8px 8px; 
    text-decoration: none; 
    text-transform: uppercase; 
} 

    JavaScript: 

     $(document).ready(function() { 
     var data; 
     function loadContent(){ 
      $.ajax({ 
       url: "json/content.json", 
       data: "nocache=" + Math.random(), 
       type: "GET", 
       contentType: "application/json", 
       dataType: "json", 
       success: function(source){ 
        data = source; 
        showInfo(); 
       }, 
       error: function(data){ 
        alert("Failed to load content"); 
       } 
      }); 

     } 

     loadContent(); 
      function showInfo(){ 
       $(".text").html(data[lang]['startpage']['text']); 
     } 
     showInfo(); 
     }); 

回答

0

問題是你的浮動:li.game-NAV 的左邊的性能,因爲它的動態更新它canot適當調整 嘗試刪除浮動:左從列表並將其添加到它的div容器

+0

只是做了這樣的看法:http://alexanderlloyd.info/test/沒有幫助:( – user1937021 2013-03-27 19:06:13

+0

它現在似乎是固定的?但使用位置:abso琵琶不是一個很好的修復,瀏覽器喜歡IE傾向於擰它 – ManZzup 2013-03-28 05:13:26

+0

謝謝!你對浮球是正確的 – user1937021 2013-03-28 08:23:49