Created
September 27, 2012 21:50
-
-
Save eristoddle/3796661 to your computer and use it in GitHub Desktop.
Scroll to Top jQuery
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
(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