Last active
December 14, 2015 16:19
-
-
Save bluespore/5114433 to your computer and use it in GitHub Desktop.
JS: Scroll to Window Hash
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
$('html, body').animate({ scrollTop : 0 }, 0); | |
if(window.location.hash) { | |
setTimeout(function(){ | |
$('html, body').animate({ | |
scrollTop : $(window.location.hash).offset().top | |
}, 1500); | |
}, 1000); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment