Skip to content

Instantly share code, notes, and snippets.

@maxxscho maxxscho/smooth-scroll.js
Last active Apr 6, 2016

Embed
What would you like to do?
Smooth Scrolling for Jumplinks
$('a.jumplink[href^="#"]').on('click', function(event) {
event.preventDefault();
var $this = $(this),
target = $this.attr('href');
if (target && target !== "#") {
$('html, body').animate({
scrollTop: $(target).offset().top
}, 600);
}
});
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.