Posted By

realpeterz on 10/06/11


Tagged


Versions (?)

Who likes this?

1 person have marked this snippet as a favorite

spee66


Smooth scroll (minimal)


 / Published in: jQuery
 

  1. $('.scrollPage').click(function() {
  2. var elementClicked = $(this).attr("href");
  3. var destination = $(elementClicked).offset().top;
  4. $("html:not(:animated),body:not(:animated)").animate({ scrollTop: destination-20}, 500 );
  5. return false;
  6. });

Report this snippet  

You need to login to post a comment.