情况1:包括滚动条的宽度高度
包含有滚动条宽度高度
滚动条的大小,有的时候是16,有的时候是17
结果只是数值
window.innerHeight 高度 window.innerWidth 宽度
情况2:不包括滚动条宽度高度
document.documentElement.clientHeight 高度 document.documentElement.clientWidth 宽度
console.log(window.innerHeight);
console.log(document.documentElement.clientHeight);