Skip to content

Instantly share code, notes, and snippets.

@SaraSoueidan
Created June 8, 2013 02:29
Show Gist options
  • Save SaraSoueidan/5733706 to your computer and use it in GitHub Desktop.
Save SaraSoueidan/5733706 to your computer and use it in GitHub Desktop.
Scroll to Section in page with easing
$(function() {
$('ul.nav a').bind('click',function(event){
var $anchor = $(this);
$('html, body').stop().animate({
scrollTop: $($anchor.attr('href')).offset().top
}, 1500,'easeInOutExpo');
event.preventDefault();
});
});
//just change the selector selected to the navigation name/class/ID and this script will
// do the rest.. no plugins or script links/calls required
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment