Created
October 25, 2020 08:42
-
-
Save tinshade/02246dbd4db9143be8f03f1769d5c504 to your computer and use it in GitHub Desktop.
Get that smooth scroll rolling from your navbar to a section on your page/across all pages. Just include this after your jQuery.
This file contains hidden or 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
$(function () { | |
$(window).on('scroll', function () { | |
if ( $(window).scrollTop() > 10 ) { | |
$('.navbar').addClass('active'); | |
} else { | |
$('.navbar').removeClass('active'); | |
} | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment