ie6,ie7,ie8完美支持position:fixed的终极解决方案
【ie6,ie7,ie8完美支持position:fixed的终极解决方案】ie6对position:fixed不支持,网上有很多解决方法,有的在ie6,ie7上调试成功后 , 在ie8上又不好使,div层还是跟随滚动条浮 动;以下总结方法,在ie6,ie7,ie8上都调试成功,且页面滚动条滚动时,效果还挺好,div层并不会闪烁 。
复制代码 代码如下:
div id="goTop_div" class="fixed ie" /div
css:
复制代码 代码如下:
.fixed{
position:fixed; /*对于火狐等其他浏览器需要设置的*/
top:700px; /*同上*/
width:30px;
height:30px;
cursor:pointer;
display:none;
}
.ie{
_position: absolute;
_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);
}
您可能感兴趣的文章:JS 滚动事件window.onscroll与position:fixed写兼容IE6的回到顶部组件js完美解决IE6不支持position:fixed的bugjavascript ie6兼容position:fixed实现思路IE6支持position:fixed完美解决方法详解IE6中的position:fixed问题与随滚动条滚动的效果
相关经验推荐
- jQuery实现简单网页遮罩层/弹出层效果兼容IE6、IE7
- bootstrap IE8 兼容性处理
- 兼容IE6/IE7/IE8/火狐 下拉菜单select样式设置
- IE6: border的transparent透明解决方案
- position:fixed IE6浏览器不支持固定定位解决方案
- 让老式浏览器识别html5 在IE6/7/8下识别html5标签
- 微软从明年1月12日起停止对IE6-IE8浏览器提供技术支持
- 原生js方法document.getElementsByClassName在ie8及其以下的兼容性问题
- IE6不兼容position:fixed属性的解决办法分享
- 如何解决IE6/IE7不识别display:inline-block属性
