Return to Snippet

Revision: 35518
at December 17, 2010 10:10 by benwellby


Updated Code
HTML:

<a href="#" class="backToTop">Back to top</a>


jQuery:

$(document).ready(function(){
	$('a.backToTop').click(function(){
		$('html, body').animate({scrollTop: '0px'}, 300);
		event.preventDefault();
	});

});

Revision: 35517
at November 9, 2010 22:30 by benwellby


Initial Code
HTML:

<a href="#" class="backToTop">Back to top</a>


jQuery:

$(document).ready(function(){
	$('a.backToTop').click(function(){
		$('html, body').animate({scrollTop: '0px'}, 300);
		return false;
	});

});

Initial URL

                                

Initial Description
Easy "back to top" scroll link

Initial Title
jQuery – Back to top link

Initial Tags
link, page, jquery

Initial Language
jQuery