Smooth Scrolling with jQuery on Page Classes and ID clicks

3 0 335 reads

Going to Top of the Page or Bottom, or at exact point developers use # tags for IDs but scroll action for that is so quick and dirty {in a designer way}. So here is a small quick snippet to just copy and paste on page where you want smooth gesture scroll on link click, it works with classes.


$(document).ready(function() {


          $("html, body").animate({ scrollTop: 0 }, 600);

     return false;




the scrollTop is the position where you want your scrollar to stop in pixels and 600 is the animation speed to that position, you can change it to your choice of scroll.

use it as:

<a class="go-top">Go to Page Top</a>

The Famous text seen on most of new Websites. It will definitely work, try to make new changes.

No Threads
more feeds from /u/ankitguptaa