We web developers like to make things easier for the user, and on a long page a “Back to Top” button can save the user from a lot of extra scrolling. I use this snippet of jQuery to accomplish it, feel free to add jQuery Easing to this for more dynamic motion:
jQuery(function() {
jQuery('.toplink').click(function() {
$("html, body").animate({
scrollTop: 0
}, "slow");
return false;
});
});
Scroll to the bottom of this website to see a live example.