Skip to content

Commit

Permalink
Merge pull request #130 from whatever-company/master
Browse files Browse the repository at this point in the history
Allow the target's offset to change
  • Loading branch information
bigspotteddog committed Apr 11, 2014
2 parents c90bc70 + fb08c7e commit 58d458d
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions jquery-scrolltofixed.js
Original file line number Diff line number Diff line change
Expand Up @@ -250,6 +250,15 @@
// happens once.
if (!isReset) {
resetScroll();
} else if (isUnfixed()) {
// if the offset has changed since the last scroll,
// we need to get it again.

// Capture the offset top of the target element.
offsetTop = target.offset().top;

// Capture the offset left of the target element.
offsetLeft = target.offset().left;
}

// Grab the current horizontal scroll position.
Expand Down

0 comments on commit 58d458d

Please sign in to comment.