Home > Web Front-end > JS Tutorial > body text

JavaScript solves the bug of not rendering under IE_javascript skills

WBOY
Release: 2016-05-16 19:12:00
Original
1113 people have browsed it

Sometimes, you will find that in some JS applications, when CSS re-rendering is involved (that is, the page style needs to be updated), IE remains unchanged.
At this point you need to let IE re-render:


function handleIEhasLayout(){
//trigger re-rendering
document.body.style.zoom = 1.1;
//restore it
document.body.style.zoom = '';
}


If there is a problem, remember to execute handleIEhasLayout and everything will be OK.

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

Quote
IE5 does not seem to have this problem, IE6 does, I IE7 is still beta2, the version number is 7.0.5346.5, and there is no such problem. A friend uses beta3, the version number is 7.0.5450.4, and actually says there is a problem. I have not tested it. Friends who use this version of IE can help.


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";
}



Using style.zoom will also work in some cases There is a problem that it cannot be fully rendered. For example, the page content is very small and does not fill the screen.
(shiweiwei97) method is:

document.body.style.display = “none”;
document.body.style.display = “”;

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