浏览器/元素尺寸相关的属性
// 返回浏览器可视区域的距离,不包含滚动条不可见部分的区域
document.documentElement.clientWidth
document.documentElement.clientHeight
// 返回浏览器页面中所有内容区域的距离,包含滚动条暂时不可见的区域。
document.body.clientWidth
document.body.clientHeight
// 返回浏览器滚动条卷去的距离
document.documentElement.scrollTop
document.documentElement.scrollLeft
// Node.offsetWidth/offsetHeight 返回元素内容区+内填充区+外边框区一共所占的位置
document.getElementById("div1").offsetWidth
document.getElementById("div1").offsetHeight