jQuery网页高度

cor*_*ore 57 jquery height webpage

假设一个网页是浏览器窗口高度的两倍(因此有一个滚动条).如何在jQuery中检索网页的高度?

rah*_*hul 136

$(window).height();   // returns height of browser viewport

$(document).height(); // returns height of HTML document
Run Code Online (Sandbox Code Playgroud)

  • 提及浏览器视口的+1.这正是我想要的! (4认同)

the*_*eIV 16

你可以使用height()文件的.

$(document).height();