完美解决IE6不支持position:fixed的BUG

完美解决IE6不支持position:fixed的BUG

/* position fixed Top */
.fixed-top {position:fixed;bottom:auto;top:0;}
/* position fixed Bottom */
.fixed-bottom {position:fixed;bottom:0;top:auto;}
/* position fixed Left */
.fixed-left {position:fixed;right:auto;left:0;}
/* position fixed right */
.fixed-right {position:fixed;right:0;left:auto;}

/* IE6 Fixed Position Jitter Fix */
* html,* html body {background-image:url(about:blank);background-attachment:fixed;}
/* IE6 position fixed Top */
* html .fixed-top {position:absolute;bottom:auto;top:expression(eval(document.documentElement.scrollTop));}
/* IE6 position fixed right */
* 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));}
/* IE6 position fixed Bottom */
* 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)));}
/* IE6 position fixed Left */
* html .fixed-left {position:absolute;right:auto;left:expression(eval(document.documentElement.scrollLeft));}

发表评论

电子邮件地址不会被公开。 必填项已用*标注