I have two superfish menus on the same block region which changes to accordion for touch devices based on width. When one of the menus is open i need the other to be closed since they overlap when both are open. So a click anywhere outside the expanded menu should close it which would be a lot useful in my opinion.

I've been trying to do that with the following

$(document).click(function() {
$('ul.sf-menu').hideSuperfishUl();
});

and tried to remove the sf-expanded class on click, which results in awkward results. Can anyone help me with this. Thanks.

Comments

fox_01’s picture

Have you found any solution for this? i am looking for a js function or something where i can close the exanded accordion if the user clicks a link with an anchor in a one page setup

geek.geek’s picture

Category: Support request » Feature request
tfranz’s picture

I'm looking for the same feature: how to close the accordion, if the user clicks on an anchor-link (or somewhere else)?
Thank you for any help!

ivnish’s picture

Status: Active » Closed (outdated)