开发者

jquery ie7 css height inconsistent result compared to firefox

开发者 https://www.devze.com 2022-12-09 01:38 出处:网络
var heightOfDIV = $thisElement.css(\'height\'); alert(heightOfDIV); The above works as I expected it to work when I am using 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 a开发者_JS百科bove 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.


Use the .height() method instead:

var heightOfDiv = $thisElement.height();
0

精彩评论

暂无评论...
验证码 换一张
取 消