Mobile Menu Child Items - Question | JoomShaper

Mobile Menu Child Items

MK

Michael Koerner

SP Page Builder 1 year 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 1 year 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
1 year 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 1 year 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