dead simple scrollToTop

by Victor

JavaScript

//insert the markup
var markup = '<a href="#" class="goToTop">^</a>';
$('html').prepend(markup);
//place it with css
$('.goToTop').css({   "text-decoration": "none", "color":"white", "background":"#222", "height":"20px", "width":"20px", "padding":"0", "line-height":"20px", "text-align": "center", "display": "inline-block"});
$('.goToTop').css({"position":"fixed", "right":"10px", "bottom": "10px"})
//enable smooth scrolling

//click function- will be a one liner
$('.goToTop').click(function(){
    $(' html, body ').animate( { scrollTop : 0 },  0 );
});