so I have a page on my website that use anchor links that can be accessed in menu but on mobile when I click on a category (anchor link) the menu isn’t closing automatically, I need to close manually by pressing on hamburger menu again.
This this is all my code from menu.js:
This doMenu function :
if( ( window.innerWidth >= options.mobileInit ) || ( ! options.responsive ) ){
// desktop --------------------------------
$( '> li, ul:not(.mfn-megamenu) li', menu ).hover(function() {
$(this).stop(true,true).addClass( options.hoverClass );
$(this).children( 'ul' ).stop(true,true).fadeIn( options.delay );
}, function(){
$(this).stop(true,true).removeClass( options.hoverClass );
$(this).children( 'ul' ).stop(true,true).fadeOut( options.delay );
});
} else {
// mobile ---------------------------------
$( 'li', menu ).unbind('hover');
$( 'li > .menu-toggle', menu ).off('click').on('click', function(){
var el = $(this).closest('li');
if( el.hasClass( options.hoverClass ) ){
el.removeClass( options.hoverClass )
.children('ul').stop(true,true).fadeOut( options.delay );
} else {
el.addClass( options.hoverClass )
.children('ul').stop(true,true).fadeIn( options.delay );
}
});
}
};