jQuery web page height

前端 未结 3 1689
执念已碎
执念已碎 2020-12-02 10:11

Let\'s say that a web page is twice the height of the browser window (thus there\'s a scroll bar). How do I retrieve the height of the web page in jQuery?

相关标签:
3条回答
  • 2020-12-02 10:47

    This can work also.

    $('body').height();
    
    0 讨论(0)
  • 2020-12-02 10:48

    You could use the height() of the document.

    $(document).height();

    0 讨论(0)
  • $(window).height();   // returns height of browser viewport
    
    $(document).height(); // returns height of HTML document
    
    0 讨论(0)
提交回复
热议问题