Skip to content
This repository was archived by the owner on Apr 28, 2020. It is now read-only.
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion smooth-scroll.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,12 +72,12 @@
return distance - headerHeight;
};
var endLocation = getEndLocation(anchor);
endLocation = endLocation < 0 ? 0 : endLocation;
var distance = endLocation - startLocation;

// Function to stop the scrolling animation
var stopAnimation = function () {
var currentLocation = window.pageYOffset;
// var there = endLocation(anchor);
if ( currentLocation == endLocation || ( (window.innerHeight + currentLocation) >= document.body.scrollHeight ) ) {
clearInterval(runAnimation);
updateURL(url, anchor);
Expand Down