Hi,
I’m trying to make it so that when on mobile you click on a sub-menu it collapses any others that were open. If all were open at the same time, the menu on mobile devices would require lots of scrolling.
I found this code in another thread, but I think it’s for X but I’m using Pro. I was hoping you might be able to adapt it to work for Pro as well?
Thanks,
Ryan
jQuery(function($) {
$(’.x-sub-toggle’).on(‘touchstart click’, function(e){
//e.preventDefault();
$(’.sub-menu’).removeClass(‘in’);
$(’.x-sub-toggle’).removeClass(‘x-active’);
$(’.x-nav > li’).removeClass(‘x-active’);
$(this).toggleClass(‘x-active’).closest(‘li’).toggleClass(‘x-active’);
$(this).parent().parent().toggleClass(‘x-active’);
});
});