您的位置:首页 > Web前端 > CSS

解决IE使用css表达式模拟fixed效果时抖动问题

2012-04-09 19:01 645 查看
<!doctype html>
<html>
<head>
<meta charset="gbk" />
<title>IE6 fixed</title>
<style>
.img1 {
position:fixed;
left:0;
bottom:10px;
_position:absolute;
_top: expression(eval(document.documentElement.scrollTop+document.documentElement.clientHeight-this.offsetHeight-(parseInt(this.currentStyle.marginTop,10)||10)-(parseInt(this.currentStyle.marginBottom,10)||10)));
}
.img2 {
position:fixed;
right:0;
top:200px;
_position:absolute;
_top: expression(eval(document.documentElement.scrollTop + 200));
}
* html,* html body {background-image:url(#);background-attachment:fixed;}/* 修正IE6 fixed振动bug */
</style>
</head>
<body style="height:9000px">
<img style="height:135px;" class="img1" src="http://img01.taobaocdn.com/tps/i1/T1TJ16XmxdXXXXXXXX-440-135.jpg">
<img style="height:135px;" class="img2" src="http://img01.taobaocdn.com/tps/i1/T1TJ16XmxdXXXXXXXX-440-135.jpg">

</body>
</html>
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐