Home Forums WoodMart support forum Adjusting Mobile Menu Behavior for Parent Categories

Adjusting Mobile Menu Behavior for Parent Categories

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #631072

    lost.hinata
    Participant

    Hello,

    On the mobile version of my site, the menu currently displays categories, and when clicking on the arrow, the categories expand to show subcategories or sub-subcategories. This behavior works perfectly for me.

    However, the parent categories at the first level are also clickable, and I would like to disable this behavior. Instead, I want clicking on the parent category name to perform the same action as the arrow, expanding the menu to show subcategories.

    How can I achieve this?

    Thank you.

    #631358

    Hung Pham
    Keymaster

    Hi lost.hinata,

    Thanks for reaching to us and appreciate your patience.

    Navigate to Theme Settings > Custom JS > Add the following code.

    jQuery('.mobile-nav').on('click', '.wd-nav-mobile > li.menu-item-has-children > a', function(e){
       e.preventDefault();
       jQuery(this).parent().find('.wd-nav-opener').click();
    });

    Regards,

Viewing 2 posts - 1 through 2 (of 2 total)