Optimizing jQuery addclass / removeclass on scroll
You shouldn't be doing so much manipulation of the classes. Instead, you could just add or remove a scrolled-down class to the &lt;body&gt; element. Then specify the rest of the changes using pure CSS.  (For example, you would have a body.scrolled-down nav { … } rule.)