Element.getBoundingClientRect()
返回元素的大小及其相对于视口的位置。
返回值:DOMRect 对象,包含 left, top, right, bottom, x, y, width, height (尽量只使用 left, top, right, bottom,因为其他属性可能有兼容问题)
滚动距离
- window.scrollX,window.scrollY
 - window.pageXOffset,window.pageYOffset (pageXOffset 属性是 scrollX 属性的别名,但兼容性更好)
 - Element.scrollTop, Element.scrollLeft
// For scrollX(((t = document.documentElement) || (t = document.body.parentNode))&& typeof t.scrollLeft == 'number' ? t : document.body).scrollLeft// For scrollY(((t = document.documentElement) || (t = document.body.parentNode))&& typeof t.scrollTop == 'number' ? t : document.body).scrollTop
 
