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

Commit 9882e1a

Browse files
author
Chris Ferdinandi
committed
Merge pull request #35 from alexguzman/master
Fix iOS stuck in infinite loop bug and Chrome browser zoom bug.
2 parents 822fbe1 + 8a04112 commit 9882e1a

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

smooth-scroll.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ window.smoothScroll = (function (window, document, undefined) {
9999
// Stop the scrolling animation when the anchor is reached (or at the top/bottom of the page)
100100
var stopAnimation = function () {
101101
var currentLocation = window.pageYOffset;
102-
if ( currentLocation == endLocation || ( (window.innerHeight + currentLocation) >= document.body.scrollHeight ) ) {
102+
if ( position == endLocation || currentLocation == endLocation || ( (window.innerHeight + currentLocation) >= document.body.scrollHeight ) ) {
103103
clearInterval(runAnimation);
104104
}
105105
};
@@ -161,4 +161,4 @@ window.smoothScroll = (function (window, document, undefined) {
161161

162162
}
163163

164-
})(window, document);
164+
})(window, document);

0 commit comments

Comments
 (0)