State of Accordion Menu

Hello,
i use Foundation for Sites 6.x for a mobile first web site. I use ‘Off-Canvas’ and inside the Accordion Menu with Submenues. Each Menu Item link to a new page and after a click i close the ‘Off-Canvas’ if the new page is loaded.
If i now open the Off-Canvas again, all parts of the Accordion are collapsed.

Question: How can i open the Accordion to that level, the user selected?
Any state i can use?
Any Javascript?

Thanks for help.

Patric

You could use session/localStorage like we do in our docs and use the JS methods to open the right menu.

Hello Daniel,
thanks for your fast reply; but could you sent some links to the topics you mean (there’s a lot of docu and a hint is very helpful)!

Patric

https://get.foundation/sites/docs/accordion-menu.html#down

We set the needed classes is-active, is-current and so on in our handlebars templates too.

You can find our custom logic at https://github.com/foundation/foundation-sites/blob/0f9fea524fec599999fdd952d55de94635f75227/docs/assets/js/docs.js#L20-L48