Last active
August 29, 2015 14:27
-
-
Save bulbul84/a6d9c7f967012d24db10 to your computer and use it in GitHub Desktop.
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
<div class="navbar-collapse collapse"> | |
<ul class="nav navbar-nav"> | |
<li class="active smooth-scroll"><a href="#home">Home</a></li> | |
<li class="smooth-scroll"><a href="#about">About</a></li> | |
<li class="smooth-scroll"><a href="#igredients">Igredients</a></li> | |
<li class="smooth-scroll"><a href="#food-menu">Menu</a></li> | |
<li class="smooth-scroll"><a href="#reviews">Reviews</a></li> | |
<li class="smooth-scroll"><a href="#contact">Reservations</a></li> | |
</ul> | |
</div> |
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
// jQuery smooth scroll | |
$('li.smooth-scroll a').bind('click', function(event){ | |
var $anchor = $(this); | |
var headerH = '60'; | |
$('html, body').stop().animate({ | |
scrollTop : $($anchor.attr('href')).offset().top - headerH + 'px' | |
}, 1200, 'easeInOutExpo'); | |
event.preventDefault(); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment