Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
smooth scroll on click to anchor link jquery #js #jquery #smoothscroll
$('a').click(function(){
$('html, body').animate({
scrollTop: $( $.attr(this, 'href') ).offset().top
}, 500);
return false;
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment