Created
January 9, 2018 12:31
-
-
Save caralgar/626b7aaffc1f7ae7785c99f13de8da6e to your computer and use it in GitHub Desktop.
Smooth scroll between pages
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// smooth on load page | |
$(document).ready(function(){ | |
var urlHash = window.location.href.split("#")[1]; | |
if (urlHash.length > 0) | |
$('html,body').animate({ | |
scrollTop: $('#' + urlHash).offset().top - 150 | |
}, 1000); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment