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

Commit

Permalink
Fix offste calculation problem when using overflow parent
Browse files Browse the repository at this point in the history
  • Loading branch information
Craga89 committed May 2, 2013
1 parent 4acc8d0 commit 6e97407
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/core/position.js
Expand Up @@ -204,13 +204,13 @@ PROTOTYPE.reposition.offset = function(elem, pos, container) {
pos.top -= parentOffset.top + (parseFloat($.css(parent, 'marginTop')) || 0);

// If this is the first parent element with an overflow of "scroll" or "auto", store it
if(!scrolled && (overflow = $.css(parent, 'overflow')) !== 'hidden' && overflow !== 'visible') { scrolled = parent; }
if(!scrolled && (overflow = $.css(parent, 'overflow')) !== 'hidden' && overflow !== 'visible') { scrolled = $(parent); }
}
}
while((parent = parent.offsetParent));

// Compensate for containers scroll if it also has an offsetParent (or in IE quirks mode)
if(scrolled && scrolled !== ownerDocument[0] || quirks) {
if(scrolled && (scrolled[0] !== ownerDocument[0] || quirks)) {
scroll(scrolled, 1);
}

Expand Down

0 comments on commit 6e97407

Please sign in to comment.