How to get the height of a body element

前端 未结 5 713
佛祖请我去吃肉
佛祖请我去吃肉 2020-12-09 17:14

Here the total height of all

\'s are 900 pixels, but the jQuery function returns the height of the body as 577 pixels. (If I remove the body CSS, it\
5条回答
  •  难免孤独
    2020-12-09 17:53

    We were trying to avoid using the IE specific

    $window[0].document.body.clientHeight 
    

    And found that the following jQuery will not consistently yield the same value but eventually does at some point in our page load scenario which worked for us and maintained cross-browser support:

    $(document).height()
    

提交回复
热议问题