• Resolved Rich Holmes

    (@reholmes27)


    I have set up the mega menu so that it should open the menu when clicking first time and go to the link if clicking a second time but it is always going directly to the link and not opening the menus?

    Thanks

    Rich

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

Viewing 11 replies - 1 through 11 (of 11 total)
  • Plugin Author megamenu

    (@megamenu)

    Hi Rich,

    Can you take off the ‘coming soon’ page so I can see the problem?

    Thread Starter Rich Holmes

    (@reholmes27)

    Sorry yep. Done.

    Rich

    Plugin Author megamenu

    (@megamenu)

    Hi Rich,

    Thanks. The sub menus are set to open on Hover at the moment. Please go to Appearance > Menus > Max Mega Menu Settings and set the Event to “Click”. Then the sub menu will appear on the first click, and the second click will go to the link.

    Edit: correction, you have it set to first click opens sub menu, second click closes sub menu.

    • This reply was modified 5 years, 11 months ago by megamenu.
    Thread Starter Rich Holmes

    (@reholmes27)

    I’ve updated that but it’s still a problem. That also affects the menu on desktop where I want it to be on hover, it’s just the mobile menu that I would like to be click?

    Rich

    Plugin Author megamenu

    (@megamenu)

    Hi Rich,

    Ah, ok, please set it back to Hover (the mobile menu should always be “click”) and I will take a look at the mobile menu now.

    Thread Starter Rich Holmes

    (@reholmes27)

    OK, done.

    Thanks.

    Plugin Author megamenu

    (@megamenu)

    Hi Rich,

    I think I see the problem. The menu html is copied/cloned (using JavaScript) into the slide out mobile container. However the events are not being cloned at the same time. When the menu is cloned to the slideout container, you either need to do that so that is clones the events too, or reinitialise Max Mega Menu once the menu has been copied:

    jQuery('.mega-menu').maxmegamenu();

    Thread Starter Rich Holmes

    (@reholmes27)

    Thanks. I see what you mean. I’ll have a dig around the theme files and see what I can do but I should be able to check if the HTML exists when clicking the hamburger icon and then trigger the maxmenu JS if not.

    Thanks.

    Rich

    Plugin Author megamenu

    (@megamenu)

    Hi Rich,

    I was just thinking the same:

    jQuery(".mobile_toggle").on("click", function() { 
        alert('reinit mmm'); 
        jQuery('.mega-menu').maxmegamenu();  
    });

    . but it only works if the mobile menu has been previously opened. Hopefully the slideout menu script triggers an event once it’s done its thing, but everything is minified so I can’t really see. Otherwise it may need a timeout delay.

    Thread Starter Rich Holmes

    (@reholmes27)

    Great thanks. I’ll see if I can find the cleanest option, otherwise I’ll use a timeout delay.

    Thanks.

    Thread Starter Rich Holmes

    (@reholmes27)

    jQuery(".mobile_toggle").on("click", function() { 
    		var mob_menu = setInterval(function(){ 
    			if (jQuery('.mega-menu').length) {
    				jQuery('.mega-menu').maxmegamenu();
    				clearInterval(mob_menu);
    			}
    		}, 1000);
    	     
    	});

    is the best solution I’ve come up with.

Viewing 11 replies - 1 through 11 (of 11 total)
  • The topic ‘First Mobile Click not Opening Menu’ is closed to new replies.