In Chrome, page won't resize after Ajax load

后端 未结 7 1639
逝去的感伤
逝去的感伤 2021-02-15 21:10

I\'ve been feverishly CSSing my way through the final leg of a site I\'m building and I\'m running into an odd quirk with Chrome only. FF and IE seem to work fine.

I a

7条回答
  •  夕颜
    夕颜 (楼主)
    2021-02-15 21:31

    It should be a pure CSS problem, I haven't used jQuery for AJAX myself but when the content is called you use this?

    document.getElementById('myDiv').innerHTML=myResult
    

    or are you using jQuery

    $('#myDiv').html(myResult);
    
    $('#myDiv').append(myResult);
    

    if you use jQuery you should clean up the div first, like this:

    $('#myDiv').html('');
    $('#myDiv').html(myResult);
    

    And if that doesn't helps you could use a fixed height and use an overflow css property

         #myDiv {
           height:600px
           overflow:auto;
         }
    

    Of course a fixed height is not always the best solution but it might help you.

提交回复
热议问题