Then there are several events on the page that dynamically add DOM elements. For example, clicking a layer will list the details of this layer, so there is no problem in ff and chrome, but in the IE6-8 every time re-layout.
For example, when I drag a layer, the content in the middle layer is displayed at the bottom. When I open the layer, the layer jumps back to the position before the drag...
At first, I didn't see that it was a re-layout... then I demonstrated N for a long time, struggled N for a long time, and finally thought it was possible that the window was triggered due to the dynamic addition of DOM nodes. resize and re-layout the page...
Finally, I couldn't help shouting "Thank Godness...". Fortunately, changing the height of the window has no effect on the page layout. Otherwise, it will be annoying...
CopyCodeThe Code is as follows: bindresizewindow: function (){
VaR OBJ = this;
$ (Window). Resize (function (){
VaR newwidth = $ (window). Width ();
If (newwidth = obj. Required wwidth) {return ;}
OBJ. initui ();
OBJ. createui ();
OBJ. Required wwidth = newwidth;
});
},
You only need to determine in the binding method that the re-layout event is triggered only when the width is changed...