hamburger close menu not closing

Solved
DreamyDeveloper
Tourist
4 0 1

On the store I am working on, we have several different themes, the hamburger menu on the original store: nobelz.myshopify.com works fine.

we also have this hamburger menu, for the mobile version on our other theme version as well: nobelz.myshopify.com/pages/dreamy

Opening it works fine. But when i want to close it, the X button won't close again. I am probably over seeing something super simple.

But for the life of me i just can't wrap my head around it.

image.png

any suggestions are super welcome.

0 Likes
NegativeSpace
Excursionist
18 3 5

This is an accepted solution.

Hey,

 

Looks like your issue is this, when you open the side menu this error pops up

NegativeSpace_0-1608602686999.png

This error is coming from the theme.min.js file when an error like this occurs in a JavaScript file it sort of breaks the whole file. Since this file appears to be handling your side menu behavior breaking it is not so good

If you click into this error you'll see this

NegativeSpace_2-1608603044630.png

This error is telling us that document.querySelector("#shopify-section-header") is null, which makes sense since there appears to be no element with the id shopify-section-header.

 

Your options are either replace any instance of document.querySelector("#shopify-section-header") with the appropriate selector or rename your header section to be header.liquid.

 

Hope this helps, let me know if you have any questions

 

 

  

 

DreamyDeveloper
Tourist
4 0 1

Cool your explanation helped alot!

Ive tried several different ways of keeping my setup of having different liquids for the different headers. but I couldn't get it to work.

The problem with messing with the theme.min.js, meant that it wouldn't work in my nobelz frontpage then, and since it is a integral part of the entire webshop i decided not to mess with it.

so i ended up putting everything into the header.liquid like you suggested and just made an if statement at the start.

DreamyDeveloper_0-1608722078701.png

After this i added extra elements to the %schema% section since you can't separate the schema section with an {% if %} statement

and just added dreamy to the end of all the ones that went for my dreamy webpage.

It's a messy fix, but at least it works now.

thanks a lot for the feedback!

 

RawObsession
New Member
4 0 0

Hi i’m having this issue as well, would you be able to tell me where to locate it in my store ? My side menu isn’t working

0 Likes
DreamyDeveloper
Tourist
4 0 1

Could you post a link @RawObsession to your store, or the page that you are trying to solve this on? If you are still having this issue it will help others to see what the problem could be.

Else you can always press f12 and click on the console/debugger to see what errors you are getting.

0 Likes