Home > Web Front-end > HTML Tutorial > IE 6 position does not support the fixed attribute solution_html/css_WEB-ITnose

IE 6 position does not support the fixed attribute solution_html/css_WEB-ITnose

WBOY
Release: 2016-06-24 12:02:43
Original
1134 people have browsed it

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); }
Copy after login

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;}
Copy after login

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 + ')');
Copy after login

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

source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template