如何获取当前可视区域的大小?
我将body中放入一个高度为1000px的div,浏览器会出现滚动条,此时,我想获得当前可视区域的高度,不是整个区域的高度,如何获取?我写了如下代码:
$(function(){
windowHeight = $(window).height();
documentHeight = $(document).height();
console.warn("windowHeight:"+windowHeight+",documentHeight:"+documentHeight);
//windowHeight:1036,documentHeight:1036
});