Javascript: a solution to bug_javascript without rendering in IE

Source: Internet
Author: User
Javascript solves the bug that IE does not render. Sometimes, you will find that in some JS applications, if CSS re-rendering is involved (that is, the page style needs to be updated), IE will remain unchanged.
Now you need to re-render IE:


Function handleIEhasLayout (){
// Trigger re-rendering
Document. body. style. zoom = 1.1;
// Restore it
Document. body. style. zoom = '';
}


If you have any questions, please remember to execute handleIEhasLayout. Everything is OK.

Original article: http://realazy.org/blog/2007/04/02/ie-haslayout-rerendering/

Reference
IE5 does not seem to have this problem. IE6 has, and I still have IE7 or beta2, and the version number is 7.0.5346.5. This is also not a problem. The beta3 version number that a friend uses is 7.0.5450.4, I have not tested it. I can help you with this version of IE.


Dnew.cn Note: it seems better to use this code:

Function reflow (){
Var B = document. body;
B. style. zoom = B. style. zoom = "1 "? "100%": "1 ";
}



Style. zoom may not be fully rendered in some cases. For example, the page content is very small and the screen is not fully occupied.
(Shiweiwei97) the method is:

Document. body. style. display = "none ";
Document. body. style. display = "";

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.