使用jquery中height()方法获取各种高度

$(window).height(); //浏览器当前窗口可视区域高度

$(document).height(); //浏览器当前窗口文档的高度

$(document.body).height();//浏览器当前窗口文档body的高度

$(document.body).outerHeight(true);//浏览器当前窗口文档body的总高度 包括border padding margin

$(window).width(); //浏览器当前窗口可视区域宽度

$(document).width();//浏览器当前窗口文档对象宽度

$(document.body).width();//浏览器当前窗口文档body的高度

$(document.body).outerWidth(true);//浏览器当前窗口文档body的总宽度 包括border padding margin

原文地址:https://www.cnblogs.com/zhanghuijing/p/6813980.html