Search code examples
jqueryfirefoxinternet-explorer-7expander

jquery ie7 css height inconsistent result compared to firefox


var heightOfDIV = $thisElement.css('height');
alert(heightOfDIV);

The above works as I expected it to work when I am using Firefox.

It returns me the div element that triggers the above code. I get the height as 393px.

however in IE7, i get auto.

This is causing me issues.

By the way, the above code is run in the afterExpand($thisElement) function of the expander jquery plugin.

Can anyone help me so that i can get the same result in IE7 as in Firefox?

Thank you.


Solution

  • Use the .height() method instead:

    var heightOfDiv = $thisElement.height();