I am fairly new to javascript and I am trying to make a second sticky menu on my site. I have the second nav change its class as you scroll down which seems to work fine. However, I want it to go back to its original class once you scroll back up. Any help? The code is below.
<script type="text/javascript">
$(window).scroll(function () {
if (window.scrollY > 200)
{
$("#top-bar").removeClass("nav-main").addClass("navbar-inner").addClass("navbar-fixed-top");
}
});
</script>
Thanks.
maybe something along the lines of an else to restore the original classes.