在Chrome浏览器,页面会阿贾克斯加载后不调整 [英] In Chrome, page won't resize after Ajax load
问题描述
我一直在紧锣密鼓地CSSing通过网站,我要建的最后一站,我的方式,我遇到了一个奇怪的夸克与Chrome浏览器而已。 FF和IE浏览器似乎做工精细。
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.
我使用jQuery来加载HTML存根,在这种情况下,很多内容来自外部博客,但是从很长的页面切换到非常短的那些我获得有关未使用的页面一英里仍然上涨到时该文件的末尾。
I am using jQuery to load HTML stubs and in this case a lot of content from an external blog, but when switching from the really long pages to the really short ones I get about a mile of unused page still tacked on to the end of the document.
下面就是其中存根被加载到貌似页面的正文:
Here's what the body of the page where the stubs are being loaded into looks like:
<body>
<div id="page">
<div id="mainWrapper">
<div id="headerFullWidth"></div>
<div id="fixedwidthcontainer">
<div id="header">
<div id="logo"><img src="images/logo.png" height="85px" width="187px"></div>
<div id="shoppingcart"></div>
</div>
<div id="shoppingCartIcon"></div>
</div>
<div class="contentSpacer"></div>
<div id="contentwrapper">
<div id="content"></div>
</div>
<div class="contentSpacer"></div>
<div id="footer">
<div id="footerContent">
<a href="#contactPopupContent" id="contactfooter">Contact Us</a><a href="#privacyPopupContent" id="privacyfooter">Privacy Policy</a><a href="#shippingPopupContent" id="shippingfooter">Shipping & Returns</a>
<div id="copyrightfooter">© 2011 Victory Barbers and Brand</div>
</div>
</div>
<div id="fullWidthFooter"></div>
</div>
</div>
</div>
</body>
我所有的负载都使用jQuery做负载()
和我有这并没有这个问题的网站的迭代。我已被移动到一个更100%的宽度风格并在过程中此问题出现了。
All of my loads are done using jQuery load()
and I have had an iteration of the site that didn't have this problem. I have been moving to a more 100% width style and this problem emerged in the process.
我的问题是:有没有办法来强制页面移动到不同的/较短的内容时重新检查其大小
My question is this: is there a way to force the page to re-check its size when moving to different/shorter content?
推荐答案
我的认为的我已经找到了解决这个。 (至少我还没有看到它发生在几分钟)。在阿贾克斯回调,与 $('格')设置内容的HTML(数据)之后;
,我调整与 $整个窗口(窗口).resize();
I think I've found a solution to this. (At least I haven't seen it happen in a few minutes). In the .ajax callback, after setting the content with $('div').html(data);
, I resize the entire window with $(window).resize();
这篇关于在Chrome浏览器,页面会阿贾克斯加载后不调整的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!