File tree Expand file tree Collapse file tree 1 file changed +8
-4
lines changed Expand file tree Collapse file tree 1 file changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -62,8 +62,10 @@ export function hasClass(el, cls) {
6262}
6363
6464/*获取当前元素的left、top偏移
65- * left:元素最左侧距离文档左侧的距离,包含滚动条
66- * top:元素最顶端距离文档顶端的距离,包含滚动条
65+ * offsetTop:元素最顶端距离文档顶端的距离,包含滚动条
66+ * offsetleft:元素最左侧距离文档左侧的距离,包含滚动条
67+ * left:元素最左侧距离文档左侧的距离,不包含滚动条
68+ * top:元素最顶端距离文档顶端的距离,不包含滚动条
6769 * right:元素最右侧距离文档右侧的距离,不包含滚动条
6870 * bottom:元素最底端距离文档底端的距离,不包含滚动条
6971 * right2:元素最左侧距离文档右侧的距离,不包含滚动条
@@ -86,8 +88,10 @@ export function getViewportOffset(element) {
8688 top = offsetTop - scrollTop ;
8789
8890 return {
89- left : left ,
90- top : top ,
91+ offsetTop,
92+ offsetLeft,
93+ left,
94+ top,
9195 right : window . document . documentElement . clientWidth - box . width - left ,
9296 bottom : window . document . documentElement . clientHeight - box . height - top ,
9397 right2 : window . document . documentElement . clientWidth - left ,
You can’t perform that action at this time.
0 commit comments