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

Commit

Permalink
Fix iOS stuck in infinite loop bug
Browse files Browse the repository at this point in the history
  • Loading branch information
alexguzman committed Feb 10, 2014
1 parent 822fbe1 commit 8a04112
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 8a04112

Please sign in to comment.