Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Smooth Scrolling for #links
//Smooth scrolling for #links
var $root = $('html, body');
$('a').click(function() {
var href = $.attr(this, 'href');
$root.animate({
scrollTop: $(href).offset().top
}, 1000, function () {
window.location.hash = href;
});
return false;
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.