Skip to content

Instantly share code, notes, and snippets.

@bulbul84
Last active August 29, 2015 14:27
Show Gist options
  • Save bulbul84/a6d9c7f967012d24db10 to your computer and use it in GitHub Desktop.
Save bulbul84/a6d9c7f967012d24db10 to your computer and use it in GitHub Desktop.
<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>
// 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