Another problem is thrown: IE7 already supports position:fixed, but IE6 does not. The solution to this problem is as follows:
Now there is an element whose id is element , it needs to achieve a fixed effect. We want it to be used under normal browsers and also want it to work normally under IE 6, then we can use CSS hack:
#element {position: fixed;top: 450px; /* 其他浏览器下定位,在这里可设置坐标*/_position: absolute; /*IE6 用absolute模拟fixed*//*IE6 动态设置top位置*/_top: expression(eval(document.documentElement.scrollTop) + 450); }
In this way, the element can be fixed at 450 pixels from the top. You can also add the following code to achieve the effect of removing page jitter:
*html body{background-image:url(about:blank);background-attachment:fixed;}
In the previous article, through _top Set the CSS style, then how to modify the expression style:
var domThis=$(this)[0];domThis.style.setExpression('top', 'eval((document.documentElement).scrollTop + ' + 50 + ')');
In this way, you can achieve the purpose of modification.
---------------------------------------- -------------------------------------------------- ---------------------------------------------
This article is not original and is reproduced from: http://www.tonitech.com/1505.html