Skip to content

Instantly share code, notes, and snippets.

@eristoddle
Created September 27, 2012 21:50
Show Gist options
  • Save eristoddle/3796661 to your computer and use it in GitHub Desktop.
Save eristoddle/3796661 to your computer and use it in GitHub Desktop.
Scroll to Top jQuery
(function($){
$.fn.topButton = function(){
return this.each(function(index){
$(this).click(function(e){
$('html, body').animate({scrollTop: 0}, 'slow');
});
});
}
})(jQuery);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment