jquery 获取浏览器宽高变化

$(window).resize(function () {          //当浏览器大小变化时
    alert($(window).height());          //浏览器时下窗口可视区域高度
    alert($(document).width());        //浏览器时下窗口文档的宽度
    alert($(document.body).height());     //浏览器时下窗口文档body的高度
    alert($(document.body).outerHeight(true)); //浏览器时下窗口文档body的总高度 包括border padding margin
});
原文地址:https://www.cnblogs.com/aytsoft/p/4654840.html