diff --git a/smooth-scroll.js b/smooth-scroll.js index 3c2a890..9023f4c 100755 --- a/smooth-scroll.js +++ b/smooth-scroll.js @@ -75,7 +75,7 @@ // Stop animation when you reach the anchor OR the bottom of the page stopAnimation = function () { var travelled = window.pageYOffset; - if ( (travelled >= (endLocation(anchor) - increments)) || ((window.innerHeight + travelled) >= document.body.offsetHeight) ) { + if ( (travelled >= (endLocation(anchor) - increments)) || ((window.innerHeight + travelled) >= document.body.scrollHeight) ) { clearInterval(runAnimation); } };