Permalink
Browse files

Fixed to work within scrolling elements

  • Loading branch information...
1 parent b7571c0 commit 6c833cf8868c5cf9a6756ecfd3a3651bdd0226e3 Brian Cray committed Jul 5, 2011
Showing with 5 additions and 3 deletions.
  1. +1 −1 tooltipsy.min.js
  2. +4 −2 tooltipsy.source.js
View

Some generated files are not rendered by default. Learn more.

Oops, something went wrong.
View
@@ -143,8 +143,10 @@
var ol = ot = 0;
if (el.offsetParent) {
do {
- ol += el.offsetLeft;
- ot += el.offsetTop;
+ if (el.tagName != 'BODY') {
+ ol += el.offsetLeft - el.scrollLeft;
+ ot += el.offsetTop - el.scrollTop;
+ }
} while (el = el.offsetParent);
}
return {left : ol, top : ot};

0 comments on commit 6c833cf

Please sign in to comment.