Skip to content

Instantly share code, notes, and snippets.

@asifsaho
Last active August 29, 2015 14:05
Show Gist options
  • Save asifsaho/27442217c59997ba11af to your computer and use it in GitHub Desktop.
Save asifsaho/27442217c59997ba11af to your computer and use it in GitHub Desktop.
JQ Animate Scroll
// smothscroll
jQuery('.menu-item a[href^="#"]').on('click',function (e) {
e.preventDefault();
jQuery('html, body').stop().animate({
'scrollTop': jQuery(jQuery(this).attr('href')).offset().top
}, 500, 'swing', function () {});
});
// smothscroll
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment