IE6不支持 position:fixed 时

底部固定:

.box{
  _position:absolute;
  _bottom:auto;
  _margin-bottom:100px;
  _top:expression(eval(document.documentElement.scrollTop+document.documentElement.clientHeight-this.offsetHeight-(parseInt(this.currentStyle.marginTop,10)||0)-(parseInt(this.currentStyle.marginBottom,10)||0)));
}


顶部固定:

.box{
  _position:absolute;
  _bottom:auto;
  _margin-top:100px;
  _top:expression(eval(document.documentElement.scrollTop)); 
}

 

右侧固定:

.box{
  _position:absolute;
  _right:auto;
  _margin-right:100px;
  _left:expression(eval(document.documentElement.scrollLeft+document.documentElement.clientWidth-this.offsetWidth)-(parseInt(this.currentStyle.marginLeft,10)||0)-(parseInt(this.currentStyle.marginRight,10)||0));}

 

左侧固定:

.box{
  _position:absolute;
  _right:auto;
  _margin-left:100px;
  _left:expression(eval(document.documentElement.scrollLeft));
}

 

 必须添加此段css,否则IE6会出现闪动

* html,* html body {background-image:url(about:blank);background-attachment:fixed;}


 

posted @ 2016-01-18 14:42  那谁家的丫头  阅读(81)  评论(0编辑  收藏  举报