Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
假设网页是浏览器窗口高度的两倍(因此有一个滚动条)。如何在 jQuery 中检索网页的高度?
$(window).height(); // returns height of browser viewport $(document).height(); // returns height of HTML document
您可以使用height()文档的。
height()
$(document).height();
这也可以工作。
$('body').height();