mrwweb / clicky-menus

Simple click-triggered navigation submenus. Accessible and progressively enhanced.
MIT License
90 stars 15 forks source link

Consider support for multiple levels of submenu #8

Open mrwweb opened 3 years ago

mrwweb commented 3 years ago

While I don't like it, it would make the script more useful to more people if this supported multiple levels of submenus. That said, doing then must not come at the expense of being able to make "mega menus" that show nested lists within the top-level submenu. Therefore, the secondary submenu feature would need to be configurable in a way that makes it opt-in.

timburg1 commented 1 year ago

I'd really appreciate support for multi-level menus. The accessibility of this offering is great - I'm a blind developer supporting blind end-users, so this is vital for me. However, I have multiple projects that need to create multi-level menus dynamically by reading in an XML file that defines the interface and this is where Clicky falls short.

ajplopez commented 7 months ago

I third this (no pun intended). This would be a fantastic addition and I would use this script even more.

mrwweb commented 7 months ago

@ajplopez I'd love to make it easier to handle that, although there is one thing you can do to make that easier. Take a look at the "Custom Submenu Selector":


<ul class="clicky-menu" data-clicky-submenu-selector=".clicky-menu > li > ul">
    <!-- menu items -->
</ul>```

Doing that will only target the first level of nested menus as hidable submenus. You'll still need to do a bit of work to reset some of the sites (`visibility: visible` for sure), but that at least gets you past the script trying to show/hide nested/tertiary submenus.
ajplopez commented 7 months ago

@mrwweb Yes! Sorry, I realized after what I needed so I deleted that last comment. Got it working great.