开发者

Undefined height

开发者 https://www.devze.com 2023-02-21 11:14 出处:网络
I have two divisions (menu and content). content\'s height is undefined so that it can expand. I wanted the menu 开发者_StackOverflowto have the height of the \"expanded\" content.

I have two divisions (menu and content). content's height is undefined so that it can expand. I wanted the menu 开发者_StackOverflowto have the height of the "expanded" content.

I actually understood how to do it with offset.Height, but the height is undefined.

Is there any way I could find the height of the expanded division?


Using jQuery you can do

$('#content').height(); //Assuming div content have id="content"


jQuery has a nice method for getting the height of an element, with examples here: http://api.jquery.com/height/

0

精彩评论

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