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

Commit

Permalink
Fixed problem with offset() scroll-fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Craga89 committed Feb 16, 2011
1 parent b34c4ca commit 418be2a
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 14 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: Sun Feb 13 15:53:13 2011 +0000
* Date: Tue Feb 15 21:05:28 2011 +0000
*/

/* Fluid class for determining actual width in IE */
Expand Down
10 changes: 5 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: Sun Feb 13 15:53:13 2011 +0000
* Date: Tue Feb 15 21:05:28 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 @@ -1506,13 +1506,13 @@ PLUGINS = QTIP.plugins = {
var pos = elem.offset(),
parent = container,
deep = 0,
addScroll = !PLUGINS.iOS,
docBody = document.body,
coffset;

if(parent) {
// Compensate for non-static containers offset
do {
if(parent[0] === document.body) { break; }
if(parent[0] === docBody) { break; }
else if(parent.css('position') !== 'static') {
coffset = parent.position();
pos.left -= coffset.left;
Expand All @@ -1524,8 +1524,8 @@ PLUGINS = QTIP.plugins = {
while(parent = parent.offsetParent());

// Compensate for containers scroll if it also has an offsetParent
if(addScroll || deep > 1) {
coffset = addScroll ? 1 : -1;
if(container[0] !== docBody || PLUGINS.iOS) {
coffset = PLUGINS.iOS ? -1 : 1;
pos.left += coffset * container.scrollLeft();
pos.top += coffset * container.scrollTop();
}
Expand Down
4 changes: 2 additions & 2 deletions dist/jquery.qtip.min.js

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions dist/jquery.qtip.pack.js

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions src/core.js
Expand Up @@ -1464,13 +1464,13 @@ PLUGINS = QTIP.plugins = {
var pos = elem.offset(),
parent = container,
deep = 0,
addScroll = !PLUGINS.iOS,
docBody = document.body,
coffset;

if(parent) {
// Compensate for non-static containers offset
do {
if(parent[0] === document.body) { break; }
if(parent[0] === docBody) { break; }
else if(parent.css('position') !== 'static') {
coffset = parent.position();
pos.left -= coffset.left;
Expand All @@ -1482,8 +1482,8 @@ PLUGINS = QTIP.plugins = {
while(parent = parent.offsetParent());

// Compensate for containers scroll if it also has an offsetParent
if(addScroll || deep > 1) {
coffset = addScroll ? 1 : -1;
if(container[0] !== docBody || PLUGINS.iOS) {
coffset = PLUGINS.iOS ? -1 : 1;
pos.left += coffset * container.scrollLeft();
pos.top += coffset * container.scrollTop();
}
Expand Down

0 comments on commit 418be2a

Please sign in to comment.