Closed skifte closed 11 years ago
It seems like the problem may be an error in the merging of options and defaults into settings, or something.
When I have multiple instances of the menu, on the same page, the last instance's options/settings are used for all.
Hi Anders,
Thanks for your feedback. I've committed a fix which should clarify the scope within private methods, which should allow you to instantiate more than one mega menu with different className settings on a page.
See 71bfe6f2655311b9a6c18c876a0ff7de1a94c4da and bb1eb353eabd734010714a938e09757675a39109
Cheers, Michael
If you initialize two or more instances of the accessible mega menu in the same page it gets all messed up.
The problem seems to be the menu variable inside _togglePanel. The context of this variable is always set to the last instance of the accessible mega menu, so it have to be reset.
This seems to do the trick (inside _togglePanel()):
menu = $(event.target).closest('.' + settings.menuClass); // correct context