Menu items not clickable on mobile

Menu items not clickable on mobile

Daniel19901
Shopify Partner
244 0 65

Hi, it came to my attention that the header items of dropdowns on mobile - so each menu item that has a dropdown only opens the menu bellow although I also connected a link to it in the navigation. Can anyone help make the dropdown headers links work as well for mobile ? (so that the link will work and the dropdown as well- like on desktop 

https://www.ildetailing.com/

Daniel19901_0-1725961938592.png

 

Replies 9 (9)

KuldeepKumar20
Shopify Partner
297 34 65

Hi

 

I have checked and It's working fine in mobile.

For Design, Development and custom changes Hire Me.
If your problem solved then Like & Accept this Solution.
Email ID: codermail30@gmail.com
Daniel19901
Shopify Partner
244 0 65

it will just open and close the submenu, but the link of that tab itself won't work

 

BSSCommerce-HDL
Shopify Partner
2292 842 1057

Hi @Daniel19901, The problem is that there is a black block that is lying on top so the bottom part will be covered.

BSSCommerceHDL_0-1725964457485.png

 

Sale banner, pop ups: Customize your sale banner, pop-ups and create countdown bar to boost conversion rate.
Simicart: Transform your Shopify store into a stunning and fully functional mobile app with just a few simple steps.
Product Labels & Badges:
Get more sales with striking labels, badges, and banners from our 10,000+ available templates.

BSS Commerce - Full-service eCommerce Agency | Use Shopify for 1$ in the first month now

Daniel19901
Shopify Partner
244 0 65

@BSSCommerce-HDL hi, you misunderstood my my friend, I meant these links : I can only open and close the submeanu with them (for this I have the +- icons), but when I click on the text side it should take me to the link of that main tab, not continue to open and close the subtabs like the +- should do

Daniel19901_0-1725964994389.png

 

BSSCommerce-HDL
Shopify Partner
2292 842 1057

Hi @Daniel19901

Step 1: Go to Shopify Admin -> Online Store ->Theme -> Edit code

Step 2: Search file theme.liquid

Step 3: Insert this code above </body> tag:

 

<script>
window.onload = () => {
let txt_has_submenus = document.querySelectorAll('#menu_mobile summary .hdt-block.hdt-line-clamp');
if(txt_has_submenus.length > 0) {
    txt_has_submenus.forEach(txt => {
      let link_url_summary = txt.closest('summary').getAttribute('data-url');
      txt.addEventListener('click', () => {
          window.location.href = link_url_summary;
      })
   })
}
}
</script>

 

Hope this can help you,

If our suggestions are useful, please let us know by giving it a like or marking it as a solution. Thank you  😍

 

Sale banner, pop ups: Customize your sale banner, pop-ups and create countdown bar to boost conversion rate.
Simicart: Transform your Shopify store into a stunning and fully functional mobile app with just a few simple steps.
Product Labels & Badges:
Get more sales with striking labels, badges, and banners from our 10,000+ available templates.

BSS Commerce - Full-service eCommerce Agency | Use Shopify for 1$ in the first month now

Daniel19901
Shopify Partner
244 0 65

@BSSCommerce-HDL thank you, but it didn't work 😞

BSSCommerce-HDL
Shopify Partner
2292 842 1057

@Daniel19901, Can you collaborate with me? I will check if it can be solved?

Sale banner, pop ups: Customize your sale banner, pop-ups and create countdown bar to boost conversion rate.
Simicart: Transform your Shopify store into a stunning and fully functional mobile app with just a few simple steps.
Product Labels & Badges:
Get more sales with striking labels, badges, and banners from our 10,000+ available templates.

BSS Commerce - Full-service eCommerce Agency | Use Shopify for 1$ in the first month now

KuldeepKumar20
Shopify Partner
297 34 65

Hi 

I have noticed that no link added on the main menu like the submenu, Kindly add the link on the main for the redirection.

You need to customize in the code for this

For the reference check the screenshot

KuldeepKumar20_0-1725969830652.png

Thanks

 

For Design, Development and custom changes Hire Me.
If your problem solved then Like & Accept this Solution.
Email ID: codermail30@gmail.com
KuldeepKumar20
Shopify Partner
297 34 65

Or you can try this code

$('.hdt-has-children.hdt-relative span.hdt-menu-link-text.hdt-block').click(function(){
var page_url = $(this).parent().parent().attr('data-url');
console.log(page_url);
window.location.href = page_url;
})

For Design, Development and custom changes Hire Me.
If your problem solved then Like & Accept this Solution.
Email ID: codermail30@gmail.com