Let's talk about the bug opera10 that has been fixed.
Divelement is a div element default style width: 100px; border-width: 0:
Window. setTimeout (function () {divelement. style. borderwidth = '20px ';}, 100 );
When the setTimeout callback is used to change the borderwidth of a DIV, opera9 does not re-render, which means it looks unchanged.
Re-rendering is performed only when the focus is switched to another window and then switched back.
I want to force him to re-render. But the problem is that opera9 has a cache mechanism to reduce reflow.
For example, I:
Window. setTimeout (function () {divelement. style. borderwidth = '20px '; divelement. style. width = '1000px' ;}, 100 );
In this way, the rendering is re-performed.
Border also changed
But once it is changed back to the original width
Border is gone.
So it doesn't seem to work to force a new rendering after the border is changed.
For example:
Window. setTimeout (function (){
Show. style. borderwidth = '20px ';
Show. style. width = '1000px '; // force re-rendering. The border change is displayed.
Show. style. width = '100px '; // restore the original width. At this time, the border becomes the original 0.
},100 );
Or
Window. setTimeout (function (){
Show. style. width = '101px ';
Show. style. borderwidth = '20px ';
Show. style. width = '100px ';
},100 );
None
Solution:
Window. setTimeout (function (){
Show. style. width = '101px ';
Show. style. borderwidth = '20px ';
Window. setTimeout (function () {Show. style. width = '100px ';}, 0 );
},100 );