Skip to content

Instantly share code, notes, and snippets.

@sourovroy
Last active March 4, 2018 08:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sourovroy/28eab6cfce737c0e1f9d195b21c6b5bc to your computer and use it in GitHub Desktop.
Save sourovroy/28eab6cfce737c0e1f9d195b21c6b5bc to your computer and use it in GitHub Desktop.
Use this code for smoth scroll
// jQuery smooth scroll
$('li.smooth-scroll a').bind('click', function(event){
event.preventDefault();
var $anchor = $(this);
var headerH = '40';
$('html, body').stop().animate({
scrollTop : $($anchor.attr('href')).offset().top - headerH + "px"
}, 1200, 'linear');
});
// Bootstrap scroll psy
$('body').scrollspy({
target: '.navbar-collapse',
offset: 95
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment