• Resolved wbmessenger

    (@wbmessenger)


    I have a top level menu item with a custom class I added in the WordPress menu admin. Previously it opened a set of login boxes by using a little custom javascript. Click the menu item, prevent default, and open a hidden box, pretty simple. Now that behaviour is broken. Is there some JS tnhat changed that prevents actions on links within the menu?

    Thanks

Viewing 1 replies (of 1 total)
  • Plugin Author megamenu

    (@megamenu)

    Hi wbmessenger,

    MMM has always unbound previously bound events from the menu items (to automatically fix conflicts with some themes that unintentionally bind their own events to MMM). It was made more robust in 2.3 which will be causing the problem for you. I may revert it back to how it was previously in 2.3.1 – I need to weigh up which option causes/fixes more problems.

    Rather than using jQuery document ready, please use this method to add your custom JS to the menu and it should start working again (and in the future):

    jQuery(".mega-menu").on("after_mega_menu_init", function() {
        jQuery("a.mega-menu-link").on("click", function(e) {
            // do something     
        });
    });

    Regards,
    Tom

    • This reply was modified 8 years ago by megamenu.
Viewing 1 replies (of 1 total)
  • The topic ‘2.3 JS Issues’ is closed to new replies.