Created
May 15, 2014 12:31
-
-
Save zetareticoli/0b2f94c6a4b503ea7728 to your computer and use it in GitHub Desktop.
Add/Remove class when scrolling page
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
$(window).scroll(function() { | |
var scroll = $(window).scrollTop(); | |
if (scroll >= 160) { | |
$(".primary-navbar").addClass("navbar-fixed-top"); | |
} | |
else { | |
$(".primary-navbar").removeClass("navbar-fixed-top"); | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment