Last active
December 17, 2015 04:39
-
-
Save fabiorochafg/5552103 to your computer and use it in GitHub Desktop.
Top of the page link with jQuery animation.
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
<a href="#" id="top-of-the-page">Top of the Page</a> |
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
$("#top-of-the-page").click(function(e) { | |
e.preventDefault(); | |
$('html, body').animate({scrollTop:0}, 'slow'); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment