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

Commit

Permalink
Merge pull request #35 from alexguzman/master
Browse files Browse the repository at this point in the history
Fix iOS stuck in infinite loop bug and Chrome browser zoom bug.
  • Loading branch information
Chris Ferdinandi committed Feb 10, 2014
2 parents 822fbe1 + 8a04112 commit 9882e1a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions smooth-scroll.js
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ window.smoothScroll = (function (window, document, undefined) {
// Stop the scrolling animation when the anchor is reached (or at the top/bottom of the page)
var stopAnimation = function () {
var currentLocation = window.pageYOffset;
if ( currentLocation == endLocation || ( (window.innerHeight + currentLocation) >= document.body.scrollHeight ) ) {
if ( position == endLocation || currentLocation == endLocation || ( (window.innerHeight + currentLocation) >= document.body.scrollHeight ) ) {
clearInterval(runAnimation);
}
};
Expand Down Expand Up @@ -161,4 +161,4 @@ window.smoothScroll = (function (window, document, undefined) {

}

})(window, document);
})(window, document);

0 comments on commit 9882e1a

Please sign in to comment.