For my dropdown menu project, I am facing an issue where the menu bar is not reappearing after collapsing the dropdown. It seems that the jQuery function responsible for toggling classes within a time interval is not executing properly. Specifically, the "toggle-off" class I am adding and removing with jQuery is causing the problem.
Here is the jQuery code snippet:
$( ".menu-close" ).click(function() {
var interval = setInterval(function () {
$( ".navbar-header" ).addClass( "toggle-on" );
$( ".navbar-header" ).removeClass( "toggle-off" );
}, 500);
clearInterval(interval);
$( "#mob-nav" ).removeClass( "margin-up" );
$( "#mob-nav" ).addClass( "margin-down" );
$( ".animated" ).removeClass( "go" );
$.scrollLock( false );
});