Snippets

Back to top link with jQuery

HTML:

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

Javascript:

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

Recommended Books on jQuery

One thought on “Back to top link with jQuery

Comments are closed.

Twitter
LinkedIn
YouTube
Instagram