Created
November 19, 2012 13:14
-
-
Save rawaludin/4110578 to your computer and use it in GitHub Desktop.
jquery : smooth scroll
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
$(document).ready(function() { | |
// animation of navigation | |
$(function() { | |
$('.nav-collapse .nav li a').bind('click',function(event){ | |
var anchor = $(this); | |
$('html, body').stop().animate({ | |
scrollTop: $(anchor.attr('href')).offset().top - $('.navbar-inner').height() - ($('.navbar-inner').height()/4.8) | |
}, 1500/*,'easeInOutExpo'*/); | |
event.preventDefault(); | |
}); | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment