Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

What are the shortcuts to getting IE6 to support fixed

2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/02 Report--

What is the shortcut for IE6 to support fixed? in view of this question, this article introduces the corresponding analysis and solution in detail, hoping to help more partners who want to solve this problem to find a more simple and easy way.

And you focus on the simple way to make IE6 support fixed, in the theme production or modification of some elements to be set to scroll with the page effect, the usual approach is to add the fixed attribute, or simply use js to achieve this function.

A simple way to get IE6 to support fixed

Recently found a small problem: in the theme creation or modification of some elements to set the effect of scrolling with the page, the usual practice is to add the fixed attribute, or simply use js to achieve this function.

However, for students who are too lazy to update js files in the background, this is not a good idea, or for students who have not yet introduced js, it is not a good idea. But if you don't use it, it won't work under IE6, a classic browser version that directly ignores fixed (there are several other issues, of course, so you want to update or throw away the browser).

With regard to the solution to this problem, my previous practice has been to use _ position:absolute to temporarily revise, of course, the effect of doing so is very different from what I imagined. Recently found a way to correct the fixed effect of IE6, as follows:

_ top:_expression (documentElement.scrollTop+ value + "px")

It's also a simple hack, and it's a really good idea for people who don't want to introduce JS and are eager to use the fixed attribute.

More:

Q: sometimes it seems to use document.body.scrollTop to get the scrolling length of the scroll bar, and the result is 0 after scrolling, so why use document.documentElement.scrollTop instead?

A: you can take a look at the source code, if not

You can use document.body.scrollTop in this sentence, otherwise you can only use document.documentElement.scrollTop.

Reason: under the standard W3C, document.body.scrollTop is always 0 and needs to be replaced by document.documentElement.scrollTop; documentElement in document.documentElement.scrollTop corresponds to html tag; and body in document.body.scrollTop corresponds to body tag.

This is the answer to the question about how to make IE6 support fixed. I hope the above content can be of some help to you. If you still have a lot of doubts to be solved, you can follow the industry information channel for more related knowledge.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report