Parent Link not activating submenu but icon does?

edited April 2017 in Menu / Mega menu
OK so I have a main menu with a few parent links that don't have subsequent pages but the submenu items do. In the menu builder I put a # in the url field for the parent links and all of the submenu items have links to their subsequent pages.

The trouble i'm experiencing is that once in responsive mode the parent menu item no longer triggers the submenu; instead I have to click on a tiny icon of a cross all the way to the right of the menu. Is there a fix for this? 

It's a bit of a silly oversight to not be able to open a submenu by the parent link itself especially in mobile mode.

Comments

  • Hi,
    This is normal, you are not using the main links but someone will, and then  it will become a problem. This is the only responsive menu  right now.
    thanks
  • Coded my own solution for anyone suffering from the same problem:

    jQuery(function($){

    var handlers = [
        // on first click:
        function() {
           $(this).addClass("hover");   
           $(this).children(".sub-menu").css("display", "block");
        },
        // on second click:
        function() {
            $(this).removeClass("hover");   
            $(this).children(".sub-menu").css("display", "none");
        }
        // ...as many more as you want here
    ];

    var counter = 0;
    if(jQuery(window).width() < 1240 ){
    $(".menu-item").click(function() {
        // call the appropriate function preserving this and any arguments
        handlers[counter++].apply(this, Array.prototype.slice.apply(arguments));
        // "wrap around" when all handlers have been called
        counter %= handlers.length;
    });
    }
    });
  • Hi FBarros, where you put that code? I couldn't get it working
  • Nevermind, I could done it pasting the code in custom js option in admin
  • Hey Joaera, yep you guessed it right. Just drop it in the custom JS area within betheme options. Sorry I didn't answer earlier but I hardly visit these forums unless I'm looking for a quick fix.
  • FBarros82  I Love you !  :x
Sign In or Register to comment.