Getting the height of a div after setting it to auto in IE
- by Dominic Godin
Hi,
I'm writing some JavaScript that changes the size of some content. To do this I need to know the size of a div within my content. If I have the following html:
<div id="wrapper">
... other stuff ...
<div id="inner" style="height:400px">Some text in here</div>
... other stuff ...
</div>
And the following JavaScript:
$('#inner').height('auto');
var height = $("#wrapper").height();
In FireFox and Chrome the height variable increases as the inner div expands to fit all the text. In IE this stays the same. I guess it doesn't redraw the div straight away. Anybody know how to get the new correct height in IE?
Cheers