This piece of code is responsible for controlling the main menu on my website. Currently, it's set up so that when I scroll down, the menu disappears, and when scrolling up, it reappears.
However, I would like the menu to always remain displayed at the top no matter how much I scroll.
Thank you in advance for your assistance.
var $fixed_enabled = jQuery("#main-nav.fixed-enabled");
if( $fixed_enabled.length > 0 ){
jQuery( '#theme-header' ).imagesLoaded(function() {
jQuery(function(){
var navScroll_1 = jQuery(document).scrollTop();
var headerHeight = $fixed_enabled .offset().top;
$window.scroll(function() {
var navScroll_2 = jQuery(document).scrollTop();
if (navScroll_2 > headerHeight){ $fixed_enabled.addClass('fixed-nav'); }
else { $fixed_enabled.removeClass('fixed-nav');}
if (navScroll_2 > navScroll_1){ $fixed_enabled.removeClass('fixed-nav-appear');}
else { $fixed_enabled.addClass('fixed-nav-appear');}
navScroll_1 = jQuery(document).scrollTop();
});
});
});
}