My page is filled with many elements, one of which is the following DIV:
<div id="root">
..................
<div id="child1">
.............
</div>
<div id="child2">
...............
</div>
</div>
The root div (#root) adjusts its width based on the content loaded.
Whenever the window is resized, a repaint() function is called within the window resize function.
$(window).resize( function () {
repaint();
});
function repaint(){
// The width returns "0" in IE8 browser and works fine in other browsers
var width=$("#root").width() || $("#root").innerWidth();
}
In IE8 browser, it always returns a width of "0", while in IE9 and other modern browsers, it returns a specific width (960px).
I'm unsure about the exact cause of this issue.
Why does it return zero width when the window is resized?
Thank you,
Siva