height() reporting different value in IE for hidden element

height() reporting different value in IE for hidden element


I found this strange issue and wanted to see if 1) anyone else had
stumbled upon it and 2) if there was a fix for it.
Using jQuery 1.2.6+ (I haven't tested with earlier versions), consider
these two statements:
$('<div></div>').appendTo('body').height();
$('<div></div>').appendTo('body').hide().height();
In Firefox, both report 0. In IE (6 & 7), the first reports 0, the
second, some value based on the font size. For example, on my site
(ericmmartin.com), with IE, I get 0 and 22.
Since it seems that jQuery sets display to none for hide(), it sounds
like an IE bug.