js 获取页面内容可见区域的高度和宽度

var h = window.innerHeight || document.documentElement.clientHeight || document.body.clientHeight;   //height
var w = window.innerWidth || document.documentElement.clientWidth || document.body.clientWidth;      //width
原文地址:https://www.cnblogs.com/houkaihua/p/4782889.html