解决IE6不支持position:fixed的bug

时间:2023-03-08 16:37:41
/*完整代码 */

/* 除IE6浏览器的通用方法 */
.ie6fixedTL
{
position: fixed;
left:;
top:;
}
.ie6fixedBR
{
position: fixed;
right:;
bottom:;
}
/* IE6浏览器的特有方法 */
/* 修正IE6振动bug */
* html, * html body
{
background-image: url(about:blank);
background-attachment: fixed;
}
* html .ie6fixedTL
{
position: absolute;
left: expression(eval(document.documentElement.scrollLeft));
top: expression(eval(document.documentElement.scrollTop));
}
* html .ie6fixedBR
{
position: absolute;
left: expression(eval(document.documentElement.scrollLeft+document.documentElement.clientWidth-this.offsetWidth)-(parseInt(this.currentStyle.marginLeft,10)||0)-(parseInt(this.currentStyle.marginRight,10)||0));
top: expression(eval(document.documentElement.scrollTop+document.documentElement.clientHeight-this.offsetHeight-(parseInt(this.currentStyle.marginTop,10)||0)-(parseInt(this.currentStyle.marginBottom,10)||0)));
}