ian*_*oar 8 javascript css ajax jquery google-chrome
我一直狂热地穿过我正在建造的网站的最后一段路线,而且我只是遇到了奇怪的奇怪怪癖.FF和IE似乎工作正常.
我正在使用jQuery来加载HTML存根,在这种情况下,来自外部博客的很多内容,但是当从非常长的页面切换到非常短的页面时,我得到大约一英里的未使用的页面仍然粘贴到结束时文献.
以下是加载存根的页面正文如下所示:
<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>
Run Code Online (Sandbox Code Playgroud)
我的所有负载都是使用jQuery完成的load(),我有一个没有这个问题的网站迭代.我一直在转向更宽100%的宽度风格,这个问题在这个过程中出现了.
我的问题是:有没有办法强制页面在转移到不同/更短的内容时重新检查其大小?
我遇到了完全相同的问题,我得到的答案是否定的。
我只能通过在 AJAX 加载后使用新内容检查新 div 的高度并使用 jQuery 设置正确的高度来解决此问题。
如果有人能找到一种强制自动调整大小的方法,那就太好了,但与此同时,无论内容量有多少,该解决方案都可以完美地工作。