Skip to content

Commit

Permalink
Update 获取DOM的offset的值.js
Browse files Browse the repository at this point in the history
  • Loading branch information
Rain120 authored Apr 9, 2019
1 parent a1c3a48 commit 1bfedc6
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions 获取DOM的offset的值.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,7 @@ function getOffset(el) {
while(el && !isNaN(el.offsetLeft) && !isNaN(el.offsetTop)) {
_x += el.offsetLeft - el.scrollLeft;
_y += el.offsetTop - el.scrollTop;
// chrome/safari
if ($.browser.webkit) {
el = el.parentNode;
} else {
// firefox/IE
el = el.offsetParent;
}
el = el.offsetParent;
}
return {
top: _y,
Expand Down

0 comments on commit 1bfedc6

Please sign in to comment.