解决position:fixed在IE6下的兼容问题;
2011-08-31 11:05
453 查看
由于在IE6下position:fixed属性不兼容,只能对IE6另取解决办法;
以下办法是我在网上收集到得最好的办法,
以#bottomRight选择器为目标div来说明;
现在要想<div id="bottomRight"></div>固定在网页右下角,不随页面滚动而滚动;
在IE6下的方法:
*html{
background-image:url(about:blank);
background-attachment:fixed;
}/*这个html,解决页面滚动时出现抖动的现象*/
#bottomRight{
bottom:0;
display:block;
height:25px;
overflow:hidden;
padding:0;
right:20px;
position:fixed;
_position:absolute;/*解决在IE6上position:fixed失效的作用的关键代码*/
_bottom:auto;
_top:expression(eval(document.documentElement.scrollTop+document.documentElement.clientHeight-this.offsetHeight-(parseInt(this.currentStyle.marginTop,10)||0)-(parseInt(this.currentStyle.marginBottom,10)||0)));
}
假如想固定在顶部只要把_top:-----这行代码改为_top:expression(eval(document.documentElement.scrollTop));即可;
以下办法是我在网上收集到得最好的办法,
以#bottomRight选择器为目标div来说明;
现在要想<div id="bottomRight"></div>固定在网页右下角,不随页面滚动而滚动;
在IE6下的方法:
*html{
background-image:url(about:blank);
background-attachment:fixed;
}/*这个html,解决页面滚动时出现抖动的现象*/
#bottomRight{
bottom:0;
display:block;
height:25px;
overflow:hidden;
padding:0;
right:20px;
position:fixed;
_position:absolute;/*解决在IE6上position:fixed失效的作用的关键代码*/
_bottom:auto;
_top:expression(eval(document.documentElement.scrollTop+document.documentElement.clientHeight-this.offsetHeight-(parseInt(this.currentStyle.marginTop,10)||0)-(parseInt(this.currentStyle.marginBottom,10)||0)));
}
假如想固定在顶部只要把_top:-----这行代码改为_top:expression(eval(document.documentElement.scrollTop));即可;
相关文章推荐
- 解决position: fixed;不兼容IE7的问题,由于IE6不支持些属性,可以不管
- 解决IE6不支持position:fixed;的问题
- 实现 IE6 下支持 position-fixed 的 CSS 属性并解决“振动”的问题
- IE6不兼容position:fixed属性的解决办法分享
- possion:fixed 在ie6下不兼容的问题解决办法
- css解决IE6、Chrome、ff 浏览器position:fixed;和闪动问题
- 真正完美解决IE6下position:fixed问题的方法{使用expression()没有抖动}
- 解决IE6浏览器下position:fixed固定定位问题
- 学习笔记 如何解决IE6 position:fixed固定定位问题{转载}
- 完美解决IE6不能兼容position:fixed
- 五行代码终极完美解决从IE6到Chrome所有浏览器的position:fixed;以及闪动问题
- 解决 IE6 position:fixed 固定定位问题!
- 解决IE6浏览器下position:fixed固定定位不抖动的问题
- 解决 IE6 position:fixed 固定定位问题
- 解决 IE6 position:fixed 固定定位问题
- 五行代码终极完美解决从IE6到Chrome所有浏览器的position:fixed;以及闪动问题
- 解决ie6下position:absolute不兼容问题
- 解决 IE6 position:fixed 固定定位问题
- 完美解决IE6不能兼容position:fixed
- js,css三种方法解决IE6下position:fixed的Bug以及闪动问题