0

次の URL を google chrome で開くと問題が発生します。最初の読み込みでは問題ありませんが、上部の 3 つの項目 (Bedingungen、Preise、So geht) の幅を更新し続けると、崩れます。Firefox では問題ありませんが、Chrome でなぜそうなるのかわかりません。ありがとう!

テキストは Ajax/json で読み込まれ、テキストの幅にしたいのでインラインです。固定幅を設定したくありません。

http://alexanderlloyd.info/test/

コード

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();
        });
4

1 に答える 1

0

問題は、li.game-nav の float:left プロパティにあります。動的に更新されるため、適切に調整できないため、float:left をリストから削除して、その div コンテナーに追加してみてください。

于 2013-03-27T18:38:11.207 に答える