Skip to content
This repository has been archived by the owner on Mar 17, 2020. It is now read-only.

Commit

Permalink
Merge pull request #28 from Caged/scroll-offsets-fix
Browse files Browse the repository at this point in the history
Use documentElement as the default for scroll offsets
  • Loading branch information
Justin Palmer committed Oct 29, 2013
2 parents ad4d927 + 41e140a commit 603dd1c
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -246,13 +246,9 @@ d3.tip = function() {
height = tbbox.height,
x = tbbox.x,
y = tbbox.y,
scrollTop = document.body.scrollTop,
scrollLeft = document.body.scrollLeft
scrollTop = document.documentElement.scrollTop || document.body.scrollTop,
scrollLeft = document.documentElement.scrollLeft || document.body.scrollLeft

if(document.documentElement && document.documentElement.scrollTop) {
scrollTop = document.documentElement.scrollTop
scrollLeft = document.documentElement.scrollLeft
}

point.x = x + scrollLeft
point.y = y + scrollTop
Expand Down

0 comments on commit 603dd1c

Please sign in to comment.