Smooth scroll (minimal)


/ Published in: jQuery
Save to your folder(s)



Copy this code and paste it in your HTML
  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


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.