SyntaxFix
Write A Post
Hire A Developer
Questions
toggleClass works too:
$(window).on("scroll", function() { $("nav").toggleClass("shrink", $(this).scrollTop() > 50) });