Last active
November 7, 2015 06:10
-
-
Save genesisneo/0e2ae4b87dfb968329c2 to your computer and use it in GitHub Desktop.
jQuery | Page smooth scroll
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
// jQuery scroll page smoothly depends on the link target ID and | |
// prevent #ID on the URL. Windows Phone has a built-in smooth-scroll | |
$('a[href^="#"]').click(function () { | |
$('html, body').animate({ scrollTop:$(this.hash).offset().top },500); | |
return false; | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment