SyntaxFix
Write A Post
Hire A Developer
Questions
You can combine "scroll" and "scrollstop" events in order to achieve desired result:
$(window).on("scroll",function(){ $('nav').addClass('shrink'); }); $(window).on("scrollstop",function(){ $('nav').removeClass('shrink'); });