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

IE6 CSS Fixed 固定位置 防闪屏

2015-09-18 15:52 666 查看
让层一直固定在页面上,常用的四个角代码,加入仿闪屏样式,稍加修改即可使用。

.fixed-top{position:fixed;bottom:auto;top:0px;}
.fixed-bottom{position:fixed;bottom:0px;top:auto;}
.fixed-left{position:fixed;right:auto;left:0px;}
.fixed-right{position:fixed;right:0px;left:auto;}
/* IE6 */
* html,* html body{background-image:url(about:blank);background-attachment:fixed;}
* html .fixed-top{position:absolute;bottom:auto;top:expression(eval(document.documentElement.scrollTop));}
* html .fixed-right{position:absolute;right:auto;left:expression(eval(document.documentElement.scrollLeft+document.documentElement.clientWidth-this.offsetWidth)-(parseInt(this.currentStyle.marginLeft,10)||0)-(parseInt(this.currentStyle.marginRight,10)||0));}
* html .fixed-bottom{position:absolute;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)));}
* html .fixed-left{position:absolute;right:auto;left:expression(eval(document.documentElement.scrollLeft));}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: