All things Shopify and commerce
We're moving the community! Starting July 7, the current community will be read-only for approx. 2 weeks. You can browse content, but posting will be temporarily unavailable. Learn more
My dropdown menu doesn't work correctly on mobile; it's supposed to expand and show the subcategories, but nothing happens when we click.
What could be the issue?
Thanks in advance
Setinit
Hello @Setinit ,
There is JS conflict in your theme. You can check the browser console for the errors.
To fix it, try to revert the custom codes or the apps you installed recently.
If nothing works then you need to go with a developer to fix it.
If you need my help to fix it please drop an email for services.
Regards
Guleria
Hello @Setinit
The menu isn't opening on mobile, right?
Hi there @Setinit Feel free to try this code and let me know if it works for you
<script>
function mobileFix(){
var a = document.querySelectorAll(`.has-child .site-nav-link`);
if (!a){
return;
}
for (var each of a){
each.addEventListener('click',function(el){
el.preventDefault();
el.target.classList.toggle('show--dropdown');
});
}
}
mobileFix();
</script>
<style>
@media (max-width:767px){
.header .nou_megamenu{
width: 100% !important;
}
.show--dropdown + .sub-menu-dropdown{
display: block !important;
}
}
</style>
No, it didn't work.