Kim Stacks
Kim Stacks

Reputation: 10812

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.

Upvotes: 0

Views: 912

Answers (1)

Greg
Greg

Reputation: 321688

Use the .height() method instead:

var heightOfDiv = $thisElement.height();

Upvotes: 2

Related Questions