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

Commit 0a522c4

Browse files
author
Chris Ferdinandi
committed
Merge pull request #14 from itsPG/use-scrollHeight
Change `offsetHeight` to `scrollHeight` to fix fixed/absolute positioning issues.
2 parents 2b1f96a + abd69e4 commit 0a522c4

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

smooth-scroll.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@
8585
// Stop animation when you reach the anchor OR the bottom of the page
8686
stopAnimation = function () {
8787
var travelled = window.pageYOffset;
88-
if ( (travelled >= (endLocation(anchor) - increments)) || ((window.innerHeight + travelled) >= document.body.offsetHeight) ) {
88+
if ( (travelled >= (endLocation(anchor) - increments)) || ((window.innerHeight + travelled) >= document.body.scrollHeight) ) {
8989
clearInterval(runAnimation);
9090
updateURL(url, anchor);
9191
}

0 commit comments

Comments
 (0)