IE6支持position:fixed完美解决方法
程序员文章站
2022-06-20 07:59:00
今天去一老外站看到了这他站上的十分平滑但却没有js,好奇,原来。。巧妙啊,分享下,相对而言比较节省资源。但效果好,使用方便,兼顾w3c。哈哈 复制代码 代码如下:
今天去一老外站看到了这他站上的十分平滑但却没有js,好奇,原来。。巧妙啊,分享下,相对而言比较节省资源。但效果好,使用方便,兼顾w3c。哈哈
<!-- compliance patch for microsoft browsers -->
<!--[if lt ie 7]><link rel="stylesheet" href="ie-stuff.css" type="text/css" media="screen"/><![endif]-->
ie-stuff.css
#footer {
position: absolute;
bottom: auto;
clear: both;
top:expression(eval(document.compatmode &&
document.compatmode=='css1compat') ?
documentelement.scrolltop
+(documentelement.clientheight-this.clientheight) - 1
: document.body.scrolltop
+(document.body.clientheight-this.clientheight) - 1);
}
复制代码 代码如下:
<!-- compliance patch for microsoft browsers -->
<!--[if lt ie 7]><link rel="stylesheet" href="ie-stuff.css" type="text/css" media="screen"/><![endif]-->
ie-stuff.css
复制代码 代码如下:
#footer {
position: absolute;
bottom: auto;
clear: both;
top:expression(eval(document.compatmode &&
document.compatmode=='css1compat') ?
documentelement.scrolltop
+(documentelement.clientheight-this.clientheight) - 1
: document.body.scrolltop
+(document.body.clientheight-this.clientheight) - 1);
}
推荐阅读
-
ie6,ie7,ie8完美支持position:fixed的终极解决方案
-
详解IE6中的position:fixed问题与随滚动条滚动的效果
-
苹果手机对网页上样式为position:fixed的弹窗支持不好的解决办法
-
DD_belatedPNG ie6 PNG透明效果完美支持
-
IE6支持position:fixed完美解决方法
-
IE下的纯CSS完美position:fixed实现方案
-
IE下的纯CSS完美position:fixed实现方案
-
iphone safari不支持position fixed的解决方法_javascript技巧
-
iphone safari不支持position fixed的解决方法_javascript技巧
-
ie6,ie7,ie8完美支持position:fixed的终极解决方案