Mobile Menu Child Items - Question | JoomShaper
Black Friday sale is live with flat 50% OFF. Sale ends soon! Grab your deal now!

Mobile Menu Child Items

MK

Michael Koerner

SP Page Builder 3 years ago

hello:

how can i make it to where when you click on the parent item in mobile menu, it collapses the children automatically. Then, if you want to click the parent one, clicking it second time takes you to that parent page?

Thanks!

0
3 Answers
Ofi Khan
Ofi Khan
Accepted Answer
Support Agent 3 years ago #94485

Hello Michael Koerner

Please use this JavaScript to Template Options -> Custom Code -> Custom JavaScript

jQuery(function($) {
    $(document).on("click", ".menu-deeper", function(event) {
        if (event.target.classList.contains('menu-toggler')) return;
        if (event.target.children.length) {
            event.preventDefault();
            event.stopPropagation();
            $(this)
                .toggleClass("menu-parent-open")
                .find(">.menu-child")
                .slideToggle(400);
        }
    });
});

This will allow the parent menu items to open child items while being clicked on titles. The rest customization is on your hand. Sorry, we do not provide customization support.

Best regards

0
MK
Michael Koerner
Accepted Answer
3 years ago #95138

Hey there Ofi:

Thank you so much for that. It worked perfectly!

Take care,

0
Ofi Khan
Ofi Khan
Accepted Answer
Support Agent 3 years ago #95447

You are welcome 😊

I have a humble request. It would be very kind of you if you can manage some moment to give us feedback on 

  1. Joomla Extension Directory
  2. TrustPilot

This will inspire us to improve.

0