Skip to content

Instantly share code, notes, and snippets.

@f1h0
Created April 7, 2016 15:19
Show Gist options
  • Save f1h0/3f53f7ea72fe3dcf6a822ab0b89ede4a to your computer and use it in GitHub Desktop.
Save f1h0/3f53f7ea72fe3dcf6a822ab0b89ede4a to your computer and use it in GitHub Desktop.
jQuery(document).ready(function($) {
$('a[href^="#"]').click(function() {
var el = $(this).attr('href');
$('body').animate({
scrollTop: $(el).offset().top
}, 2000);
return false;
});
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment