With a header that utilizes the off-canvas element for each of the primary links, the default behavior is that they all have the ability to be open at once. So, as one clicks through the off canvas toggles, they also have to click back through to hide each of them individually.
The JS below is from another support topic and was successful in making it so clicking a toggle would close the open off-canvas and open the new one associated with the clicked toggle.
The only issue is that a toggle isn’t able to close it’s own off canvas area—just the one opened by another toggle. Thus, requiring one to click off the canvas area as the only way to close it. It’s not a huge inconvenience, it just makes the toggle that opens an off canvas area seem like it’s broken when trying to close it.
I’m wondering if there’s any obvious addition that could fix that?
JS from topic:
jQuery(function($) {
$(’.x-menu li.menu-item a.x-anchor’).on(‘click touchend’, function(event) {
var button = $(".x-off-canvas-close");
if( button.length > 0 ){
button.trigger(‘click’);
}
});
});