• Resolved cvanbemmel

    (@cvanbemmel)


    The responsive menu in the illdy theme doesn’t close when it contains both links to other pages/sites and anchors. I really would like to replace the responsive menu by Max Mega Menu. How to achieve this? I already installed it, the mega menu is opened by clicking the hamburger, but still the menu is not closing after clicking a link.

    The page I need help with: [log in to see the link]

Viewing 5 replies - 1 through 5 (of 5 total)
  • Thread Starter cvanbemmel

    (@cvanbemmel)

    I already used the js code from https://www.megamenu.com/documentation/close-menu-after-click/ but it doesn’t seem to work ??

    Plugin Author megamenu

    (@megamenu)

    Hi cyvan,

    Please can you try this JavaScript instead?

    /* Max Mega Menu 
     * Close the mobile menu as soon as a menu item is clicked */
    jQuery(".max-mega-menu").on("after_mega_menu_init", function() {
        jQuery("li.mega-menu-item:not(.mega-menu-item-has-children) > a.mega-menu-link").on('click', function(e) {
            jQuery(".mega-menu-open").removeClass("mega-menu-open");
            jQuery(".responsive-menu").css('display', '').removeClass('active');
        });
    });

    Regards,
    Tom

    Thread Starter cvanbemmel

    (@cvanbemmel)

    Hi Tom,

    Thanks for your reply. It works perfectly. I needed to take care that the script runs from the footer. From the header it is not working, which caused a bit confusion to me.

    Just a small glitch; when clicking contact, the page scrolls to the #contact-us section but also the submenu opens. Now the menu is not closing anymore. Any ideas how to handle this?

    Warm regards,
    Cornelis

    • This reply was modified 5 years, 2 months ago by cvanbemmel.
    Plugin Author megamenu

    (@megamenu)

    Hi Cornells,

    You could try this instead:

    /* Max Mega Menu 
     * Close the mobile menu as soon as a menu item is clicked */
    jQuery(".max-mega-menu").on("after_mega_menu_init", function() {
        jQuery("li.mega-menu-item > a.mega-menu-link").on('click', function(e) {
            jQuery(".mega-menu-open").removeClass("mega-menu-open");
            jQuery(".responsive-menu").css('display', '').removeClass('active');
        });
    });

    .. but it may become impossible to reveal the contents of the contact us sub menu (although clicking on the arrow may work)

    Regards,
    Tom

    Thread Starter cvanbemmel

    (@cvanbemmel)

    Great, thanks!

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘How to replace the illdy theme responsive menu?’ is closed to new replies.