outerHeight(true) gives wrong value

前端 未结 10 1455
旧时难觅i
旧时难觅i 2021-01-07 18:21

I want the height of a container element, including margins and paddings.

When I hover over the element in Chrome development tool, I get the value that I\'m lookin

10条回答
  •  说谎
    说谎 (楼主)
    2021-01-07 18:27

    If the window is loaded and the document ready and you have accounted for floats and you still get this issue then consider looking for an element with the same id. Be certain you are getting the right element with your jQuery selector. I forgot I had another element in the dom with the exact same id. Consider using jQuery to change the background color to verify.

提交回复
热议问题