Close MAIN menu after click/tap?
-
Hi guys,
Awesome plugin, thanks for putting it out there! It’s working well for my new project, which is launching this morning, but I’m having trouble effecting a particular behavior and I can’t figure out where the source of the problem lies. The behavior in question is this one, but with the main menu, not the mobile menu (I’m using the former for all devices):
https://www.maxmegamenu.com/documentation/close-mobile-menu-after-click/I tried modifying this to match the main menu’s classes, but it’s not working:
jQuery(document).ready(function($) { $("a.mega-menu-link").on('click', function(e) { $(".mega-menu-open").removeClass("mega-menu-open"); jQuery('#mega-menu-top-navigation').data('maxmegamenu').hideAllPanels(); }); });
One possible problem area is where this code is being placed. I’ve tried including it in the header between
<script></script>
tags, as well as loading the same thing in the footer and finally in an external ‘.js’ file. So it’s possible that the implementation is flawed. It’s also possible that there’s a conflict with the Divi theme that’s stopping the script from executing. And of course it’s possible that my modified script isn’t right.Any ideas? Thanks!
- The topic ‘Close MAIN menu after click/tap?’ is closed to new replies.