获取浏览器可视区域、屏幕的宽和高

document.documentElement.clientWidth:取得浏览器页面可视区域的宽度

document.documentElement.clientHeight:取得浏览器页面可视区域的高度

screen.width:取得屏幕宽度

screen.height:取得屏幕高度

screen.availWidth:取得除任务栏外的屏幕宽度

screen.availHeight取得除任务栏外的屏幕高度
原文地址:https://www.cnblogs.com/smile-rain/p/4628540.html