Why would jquery return 0 for an offsetHeight when firebug says it's 34?

后端 未结 5 1210
佛祖请我去吃肉
佛祖请我去吃肉 2020-12-19 04:43

So I have a div whose content is generated at runtime it initially has no height associated with it. When it\'s generated according to firebug and from what I can alert wit

5条回答
  •  佛祖请我去吃肉
    2020-12-19 05:06

    I just found an issue where I was getting the offsetHeight of an element when the doc was ready but it was in a container that was hidden.

    It resulted in a offsetHeight value of 0 but firebug said it had a height of 32.

提交回复
热议问题