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屬性
