获取屏幕高度

1:除去上下导航高度,文档可见宽度高度:window.innerHeight()/window.innerWidth

2:整个屏幕的宽高:screen.availHeight/Width

3:获取当前元素到父元素顶部的距离:height=当前元素.offsetTop

当前元素的绝对定位的父元素的距离:parent=当前元素.offsetParent

原文地址:https://www.cnblogs.com/sadydai/p/5455590.html