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

Commit

Permalink
Small patch that fixes container scroll offset
Browse files Browse the repository at this point in the history
  • Loading branch information
Craga89 committed Jan 12, 2011
1 parent ac7cdd4 commit aa6343c
Show file tree
Hide file tree
Showing 5 changed files with 86 additions and 72 deletions.
2 changes: 1 addition & 1 deletion dist/jquery.qtip.css
Expand Up @@ -9,7 +9,7 @@
* http://en.wikipedia.org/wiki/MIT_License
* http://en.wikipedia.org/wiki/GNU_General_Public_License
*
* Date: Wed Jan 12 21:12:16 2011 +0000
* Date: Wed Jan 12 21:13:05 2011 +0000
*/

/* Fluid class for determining actual width in IE */
Expand Down
17 changes: 12 additions & 5 deletions dist/jquery.qtip.js
Expand Up @@ -9,7 +9,7 @@
* http://en.wikipedia.org/wiki/MIT_License
* http://en.wikipedia.org/wiki/GNU_General_Public_License
*
* Date: Wed Jan 12 21:12:16 2011 +0000
* Date: Wed Jan 12 21:13:05 2011 +0000
*/

"use strict"; // Enable ECMAScript "strict" operation for this function. See more: http://ejohn.org/blog/ecmascript-5-strict-mode-json-and-more/
Expand Down Expand Up @@ -165,11 +165,18 @@ function QTip(target, options, id)
function offset(elem, container) {
var pos = { left: 0, top: 0 },
addScroll = !$.fn.qtip.plugins.iOS,
$container = $(container),
offsetParent, parentIsContainer;

if(container && $(container).css('position') !== 'static') {
pos = offset(container);
pos.left *= -1; pos.top *= -1;
if(container) {
if($container.css('position') !== 'static') {
pos = offset(container);
pos.left *= -1; pos.top *= -1;
}
else if($container.css('overflow') !== 'visible') {
pos.left -= container.scrollLeft;
pos.top -= container.scrollTop;
}
}

if(elem.offsetParent) {
Expand All @@ -182,7 +189,7 @@ function QTip(target, options, id)
}
while(elem = offsetParent);
}

return pos;
}

Expand Down

0 comments on commit aa6343c

Please sign in to comment.