IE6下的fixed实现

\..IE6下的fixed实现。\

最近要整理一些这些年来遇到的关于IE6下一些很头痛的问题。。。这是一条。position: fixed; 在IE6下这个属性是莫有的,纯CSS实现的效果是最好的,不过要使用到expression表达式,这个东东大家看着用,会产生性能问题,另外一种呢是JS实现,不过有个不好的地方就是会闪动。。我们这边实现固定顶部的效果,只给出CSS方式哈。 上代码: 1、先去抖动: html{ _background-image:url(about:blank); _background-attachment:fixed; } .fixedTop{ _position: absolute; _top:expression_r(eval_r(document.documentElement.scrollTop)); } 这样就搞定了。这里有一个eval,是为了解决缓存问题。

ms不ok啊

top:expression(eval(document.documentElement.scrollTop+document.documentElement.clientHeight-this.offsetHeight-(parseInt(this.currentStyle.bottom,10)||0)-(parseInt(this.currentStyle.marginTop,10)||0)-(parseInt(this.currentStyle.marginBottom,10)||0)));还得用这个

_filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(enabled="true",sizingmethod="crop",src="http://img04.taobaocdn.com/tps/i4/T12EeuXeVbXXXXXXXX-350-200.png");

_background:none;}

a{position:relative}

原文地址:https://www.cnblogs.com/jinbiao/p/2218128.html