-
☆ A M B ☆
- 24,524 Posts
If you are using Wayfinder to generate the HTML for the menu, it will add the classname of your choice to the active menu item. There are two options; one to give a classname to the active item and its parents all the way up to the top-level, or one to give a classname only to the actual active item.
You can use mini-templates for Wayfinder’s output to have it generate any kind of containers you want; by default it uses nested unordered lists.
Then the javascript only needs to work with the HTML elements that Wayfinder generated.