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!
Starting a B2B store is a big undertaking that requires careful planning and execution. W...
By JasonH Sep 23, 2024By investing 30 minutes of your time, you can unlock the potential for increased sales,...
By Jacqui Sep 11, 2024We appreciate the diverse ways you participate in and engage with the Shopify Communi...
By JasonH Sep 9, 2024