Fork me on GitHub
.net求学者

解决IE6不支持position:fixed的bug

/*完整代码 */

/* 除IE6浏览器的通用方法 */
.ie6fixedTL
{
    position: fixed;
    left: 0;
    top: 0;
}
.ie6fixedBR
{
    position: fixed;
    right: 0;
    bottom: 0;
}
/* 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)));
}

 

posted @ 2013-12-30 18:24  hy31337  阅读(141)  评论(0编辑  收藏  举报
.net求学者