Created
June 8, 2013 02:29
-
-
Save SaraSoueidan/5733706 to your computer and use it in GitHub Desktop.
Scroll to Section in page with easing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$(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