SegmentFault 思否javascript offsetTop是指距离其最近offsetParent父元素的top距离. The HTMLElement.offsetTop read-only property returns the distance of the current element relative to the top of the [offsetParent] offsetParent是指向一个元素的 来自segmentfault.com的其他内容JS基础篇--JS获取元素的宽高以及offsetTop,offsetLeft等的属性值递归获取页面元素的真实offsetLeft和offsetTop更多内容请查看https://segmentfault.com/q/1010000023864364