jQuery Auto Scroll To Top Of Page
Share
You can use jQuery to automate a slow scroll to the top of your webpage by using a simple code snippet below. Why?
- It saves the user time scrolling to the top if your page is long
- It looks cool.
jQuery scroll to top
jQuery(document).ready(function($) {
$('a[href=#topbar]').click(function(){
$('html, body').animate({scrollTop:0}, 'slow');
return false;
});
});