开发者

IE infinite scroll bug in quirks mode

开发者 https://www.devze.com 2023-03-03 10:21 出处:网络
So this one\'s been stumping me. What I need is an absolutely positioned container with an css expression that pins it to the bottom of the page (to compensate for wonkiness in simulating fixed positi

So this one's been stumping me. What I need is an absolutely positioned container with an css expression that pins it to the bottom of the page (to compensate for wonkiness in simulating fixed positioning for doctypeless or DTD-less IE), while containing another absolutely posi开发者_运维知识库tioned element that at some point is below the browser's viewport. Since this is content that will be included in others' webpages, I can't depend on a proper doctype for this to display correctly. Anything that puts the inside element below the viewport---padding, margins, or positioning--will cause the page to scroll forever in IE.

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"><head>
<style type="text/css">

#footer {
position: expression("absolute");
_top:expression(document.body.scrollTop+document.body.clientHeight-this.clientHeight);
width:800px;
height:800px;
background-color:blue;
}
#huh {

position:absolute;
bottom:-20px;
width:400px;
height:400px;
background-color:red;
}

        <br/>eh<br/>eh<br/>eh<br/>eh<br/>eh<br/>eh<br/>eh<br/>eh<br/>eh<br/>eh<br/>eh<br/>eh<br/>eh<br/>eh<br/>eh<br/>eh<br/>eh<br/>eh<br/>eh<br/>eh<br/>eh<br/>eh<br/>eh<br/>eh<br/>eh<br/>eh<br/>eh<br/>eh<br/>eh<br/>eh<br/>eh<br/>eh<br/>eh<br/>eh<br/>eh<br/>eh<br/>eh<br/>eh<br/>eh<br/>eh<br/>eh<br/>eh<br/>eh<br/>eh<br/>eh<br/>eh<br/>eh<br/>eh
<div id="footer">
   <div id="huh">

   </div>
</div>
</body>
</html>

Needing both to be absolutely positioned really ties my hands on this. Relatively positioning the huh div messes with the display of the wrapper in my non-test case. Any ideas?

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号