开发者

Calculate innerwidth of a jquery dialog

开发者 https://www.devze.com 2022-12-25 22:53 出处:网络
I am trying to calculate the innerwidth of jquery dialog (ui-1.8) For somereason it is always returning 0. One reason per开发者_高级运维haps is that the dialog is still hidden and not open??

I am trying to calculate the innerwidth of jquery dialog (ui-1.8)

For somereason it is always returning 0. One reason per开发者_高级运维haps is that the dialog is still hidden and not open??

Was using

 $('#dialogId').innerwidth()

Any help?


Give this method a shot, from SO post. It worked for me in past: jQuery - Get Width of Element when Not Visible (Display: None)

You set the visibility to hidden and display to block, then check width then revert.


Seems like you are correct. innerWidth() in fact changes according to the element visibility.

Check this example

0

精彩评论

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