Hello! I found some code through the forums that auto closes the nav bar on mobile when a user clicks it. My website uses multiple one page nav menus and some of those have submenus that, when expanded, cover up the entire screen on mobile. To get rid of the clutter and clean things up I used this code:
jQuery(function($) {
$(’.mobile .x-nav a’).on(‘touchend click’, function(){
$(’.x-btn-navbar’).click();
});
});
The only problem is that it auto-closes the downward arrow icon that expands the submenu along with all the other menu items. Everything else works just as it should. When they click, it closes up the menu and moves to the spot on the page it needs to. Is there something I can do to get all of the menus to auto-close on touch except the expand submenu arrows? I appreciate any help you can give me. My website is on a test url at testing.mccullersbrothers.com