Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

return to first level #9

Open
MDcSystem opened this issue Mar 1, 2022 · 2 comments
Open

return to first level #9

MDcSystem opened this issue Mar 1, 2022 · 2 comments

Comments

@MDcSystem
Copy link

Hi,
after navigating the menu to the second or third level,
when I close the menu with ESC, or click on the desktop or use X, I don't return to the first level.
Is there an option to always return to the first level?

Greetings,
Marco

@ma-5
Copy link
Owner

ma-5 commented Mar 1, 2022

Try remove .ma5menu__panel--active class when menu is opened and add this to lvl0

$('.ma5menu--active .ma5menu__toggle').on('click', function() {
    $('.ma5menu__panel--active').removeClass('ma5menu__panel--active');
    $('.ma5menu__panel.lvl-0').addClass('ma5menu__panel--active');
});

@MDcSystem
Copy link
Author

Great it's function, I have modify as:
$('.ma5menu__toggle').on('click touch', function() {
$('.ma5menu__panel--active').removeClass('ma5menu__panel--active');
$('.ma5menu__panel.lvl-0').addClass('ma5menu__panel--active');
});

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants