Last active
March 4, 2018 08:35
-
-
Save sourovroy/28eab6cfce737c0e1f9d195b21c6b5bc to your computer and use it in GitHub Desktop.
Use this code for smoth 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
// 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