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 = “”;