jQuery outer height is zero?

巧了我就是萌 提交于 2019-12-05 01:27:41
Blair McMillan

With jQuery you can only get the height of an element if it is visible. So make sure that it is visible at the time that your JS runs, or use one of the several workarounds if you need it to be hidden at the time.

As you mentioned in your comments, the div was hidden and then fading in.

If search_form contains floats, try overflow:hidden; on it. If it contains images, try $(window).load(function(){ /* code */ }).

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!