您的位置:首页 > 其它

IE6不支持 position:fixed 时

2016-01-18 14:42 281 查看
底部固定:

.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;}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: