Shopify themes, liquid, logos, and UX
Is there a way to open the menu tree by clicking on the menu itself, not just the '+' area?
on mobile not desktop
store URL
Solved! Go to the solution
This is an accepted solution.
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
I appreciate your help. I added the code, but the issue persists. The submenu still requires manual clicking on the "+."
Any additional suggestions?
issue persists.
Can you take a quick look at this video screen recording Please
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) { ...) ?
Thanks
Yes, I implemented the changes, but the three dots on the right are unclickable.
I removed the code from the theme.liquid file, right?
This is an accepted solution.
Thanks a bunch for your assistance! Much appreciated!
We appreciate the diverse ways you participate in and engage with the Shopify Communi...
By JasonH Sep 9, 2024Thanks to everyone who participated in our AMA with 2H Media: Marketing Your Shopify St...
By Jacqui Sep 6, 2024The Hydrogen Visual Editor is now available to merchants in Shopify Editions | Summer '...
By JasonH Sep 2, 2024