Re: open the menu tree by clicking on the full menu Area

Solved

open the menu tree by clicking on the full menu Area

MohamedHegazy
New Member
5 0 0

Is there a way to open the menu tree by clicking on the menu itself, not just the '+' area? 

on mobile not desktop

Screenshot 2023-12-25 at 1.09.38 PM.jpeg

 

 

 

 

store URL

https://mkaank.com/

Accepted Solution (1)
Justin-Simesy
Shopify Partner
39 8 3

This is an accepted solution.

Hi. Yes. Please removed the code from the theme.liquid file.

 

Also please remove <script> and </script> tag from this code

 

JustinSimesy_0-1704046779963.png

 

Thanks,

Justin

Smartify - FREE Post Purchase Survey


- Was my answer helpful? Please hit Like or Mark it as solution!
- Get in touch with us: App Store | Website

View solution in original post

Replies 8 (8)

Justin-Simesy
Shopify Partner
39 8 3

Hi @MohamedHegazy. Hope you are doing well. Could you please try adding this code at the end of theme.liquid file (before </body> tab) ?

<script>
document.querySelectorAll(".offcanvas__menu_item, .offcanvas__sub_menu_item").forEach(function (toggle) {
    const parent = toggle.parentElement;
    if (parent.querySelectorAll(".offcanvas__sub_menu_toggle").length > 0) {
        toggle.addEventListener("click", function (e) {
        e.preventDefault();
        parent.querySelectorAll(".offcanvas__sub_menu_toggle").forEach(function (button) {
            button.click();
        });
      });
    }
});
</script>

 

Please let me know if it not works.

 

Thanks

Smartify - FREE Post Purchase Survey


- Was my answer helpful? Please hit Like or Mark it as solution!
- Get in touch with us: App Store | Website
MohamedHegazy
New Member
5 0 0

I appreciate your help. I added the code, but the issue persists. The submenu still requires manual clicking on the "+."

Any additional suggestions?

Screenshot 2023-12-31 at 7.11.59 PM.png

 

Justin-Simesy
Shopify Partner
39 8 3

Please try adding these code before </body> tag, NOT <body> tag.

Smartify - FREE Post Purchase Survey


- Was my answer helpful? Please hit Like or Mark it as solution!
- Get in touch with us: App Store | Website
MohamedHegazy
New Member
5 0 0

issue persists.

Can you take a quick look at this video screen recording Please

MohamedHegazy_0-1704044278297.png

 

 

Justin-Simesy
Shopify Partner
39 8 3

No worry. Can you try to find mobile-nav.js (inside assets) folder of your theme code then adding my custom code here (before document.addEventListener("click", function (event) { ...) ?

 

JustinSimesy_0-1704044645667.png

 

Thanks

 

Smartify - FREE Post Purchase Survey


- Was my answer helpful? Please hit Like or Mark it as solution!
- Get in touch with us: App Store | Website
MohamedHegazy
New Member
5 0 0

Yes, I implemented the changes, but the three dots on the right are unclickable.

MohamedHegazy_0-1704045523039.png

 

 

I removed the code from the theme.liquid file, right?

Justin-Simesy
Shopify Partner
39 8 3

This is an accepted solution.

Hi. Yes. Please removed the code from the theme.liquid file.

 

Also please remove <script> and </script> tag from this code

 

JustinSimesy_0-1704046779963.png

 

Thanks,

Justin

Smartify - FREE Post Purchase Survey


- Was my answer helpful? Please hit Like or Mark it as solution!
- Get in touch with us: App Store | Website
MohamedHegazy
New Member
5 0 0

Thanks a bunch for your assistance! Much appreciated!