解决ie6下position:absolute不兼容问题

来源:互联网 发布:js判断上传文件的类型 编辑:程序博客网 时间:2024/04/30 22:27
<span style="font-family: Arial, Helvetica, sans-serif;"></span>
 body{9000px;}  /*让浏览器出现滚动条*/ .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); }

<div id="goTop_div" class="fixed ie">  </div>

ie6对position:fixed不支持,网上有很多解决方法,有的在ie6,ie7上调试成功后,在ie8上又不好使,div层还是跟随滚动条浮 动;以下总结方法,在ie6,ie7,ie8上都调试成功,且页面滚动条滚动时,效果还挺好,div层并不会闪烁。
0 0