Skip to content

Instantly share code, notes, and snippets.

@maxxscho
Last active April 6, 2016 08:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save maxxscho/b8e329bd8f7f6e55f260ef0036809ce8 to your computer and use it in GitHub Desktop.
Save maxxscho/b8e329bd8f7f6e55f260ef0036809ce8 to your computer and use it in GitHub Desktop.
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