Navigation Menu

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

Commit

Permalink
Fixed scroll offset problem when using container property
Browse files Browse the repository at this point in the history
  • Loading branch information
Craga89 committed Feb 23, 2011
1 parent e5942fd commit d26dc19
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 16 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 Feb 23 00:35:04 2011 +0000
* Date: Wed Feb 23 18:53:51 2011 +0000
*/

/* Fluid class for determining actual width in IE */
Expand Down
12 changes: 6 additions & 6 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 Feb 23 00:35:04 2011 +0000
* Date: Wed Feb 23 18:53:51 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 @@ -1510,9 +1510,9 @@ PLUGINS = QTIP.plugins = {
docBody = document.body,
coffset;

function scroll(e) {
pos.left -= e.scrollLeft();
pos.top -= e.scrollTop();
function scroll(e, i) {
pos.left += i * e.scrollLeft();
pos.top += i * e.scrollTop();
}

if(parent) {
Expand All @@ -1530,8 +1530,8 @@ PLUGINS = QTIP.plugins = {
while(parent = parent.offsetParent());

// Compensate for containers scroll if it also has an offsetParent
if(container[0] !== docBody) { scroll( container ); }
if(PLUGINS.iOS) { scroll( $(window) ); }
if(container[0] !== docBody || deep > 1) { scroll( container, 1 ); }
if(PLUGINS.iOS) { scroll( $(window), -1 ); }
}

return pos;
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.

10 changes: 5 additions & 5 deletions src/core.js
Expand Up @@ -1468,9 +1468,9 @@ PLUGINS = QTIP.plugins = {
docBody = document.body,
coffset;

function scroll(e) {
pos.left -= e.scrollLeft();
pos.top -= e.scrollTop();
function scroll(e, i) {
pos.left += i * e.scrollLeft();
pos.top += i * e.scrollTop();
}

if(parent) {
Expand All @@ -1488,8 +1488,8 @@ PLUGINS = QTIP.plugins = {
while(parent = parent.offsetParent());

// Compensate for containers scroll if it also has an offsetParent
if(container[0] !== docBody) { scroll( container ); }
if(PLUGINS.iOS) { scroll( $(window) ); }
if(container[0] !== docBody || deep > 1) { scroll( container, 1 ); }
if(PLUGINS.iOS) { scroll( $(window), -1 ); }
}

return pos;
Expand Down

0 comments on commit d26dc19

Please sign in to comment.