Solved

Drop down menu doesn't work on only product pages

toYoto
Visitor
2 0 1

My drop down menu on the header doesn't work on only product pages. It works fine on the other pages. Only on product pages. According to Chrome console, "theme.js" has some errors, but unfortunately I'm not familiar with javascript. So I would appreciate it if you could help me solve the issue.

 

 

Thanks.

Accepted Solution (1)

UmarFarooq99
Shopify Partner
12 2 3

This is an accepted solution.

Hello, I've reviewed your page and didn't find any errors. However, I've quickly created a fix for you.

just copy paste this code in your product page file above schema

<script>
$(".site-nav--has-dropdown .site-nav__link--button").blur(function(){
    $(this).parent("li").removeClass("site-nav--active-dropdown");
});
$(".site-nav--has-dropdown .site-nav__link--button").focus(function(){
    $(this).parent("li").addClass("site-nav--active-dropdown");
});
</script>

 

View solution in original post

Replies 3 (3)

azamgill
Shopify Partner
314 46 68

Hey @toYoto ,

 

The problem is with the JS. You need to fix the conflict with the JS. It's hard to figure out the problem without having the access to the code.

 

 

Untitled-1.png

Azam Gill
- Was my reply helpful? Click Like to let me know!
- Was your question answered? Mark it as an Accepted Solution
- Encourage me ❤️

Come and visit us at Wbify

UmarFarooq99
Shopify Partner
12 2 3

This is an accepted solution.

Hello, I've reviewed your page and didn't find any errors. However, I've quickly created a fix for you.

just copy paste this code in your product page file above schema

<script>
$(".site-nav--has-dropdown .site-nav__link--button").blur(function(){
    $(this).parent("li").removeClass("site-nav--active-dropdown");
});
$(".site-nav--has-dropdown .site-nav__link--button").focus(function(){
    $(this).parent("li").addClass("site-nav--active-dropdown");
});
</script>

 

toYoto
Visitor
2 0 1

It works now!! Thank you so much.