(转载)js获取各种页面高度的方法

非原创。

获取各种页面高度,比较有用,记录一下。

转载地址:https://blog.csdn.net/sunshineboysy/article/details/96385090

另外还有

$(window).height()代表了当前可见区域的大小,浏览器页面高度
$(document).height()则代表了整个文档的高度。body高度。

存在:

$(document).scrollTop() + $(window).height() = $(document).height() 

$(document).scrollTop() 获取垂直滚动的距离 

如果有:$(window).height() = $(document).height()

那就是因为DOCTYPE没写造成的

记录编程的点滴,体会学习的乐趣
原文地址:https://www.cnblogs.com/AduBlog/p/13969238.html