IE6 固定定位

非IE6的浏览器都可以直接使用 fixed 实现固定定位。

针对IE6:(定位在上方)

#toTop{
    _position:absolute;
    _bottom:auto;
    _top:expression(eval(document.documentElement.scrollTop));
}

(定位在下方)

#toTop{
    _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)));
}

 

posted @ 2013-12-31 23:54  白小虫  阅读(175)  评论(0编辑  收藏  举报