Menu Button no longer works on mobile; supply theme

Discovery_Hut
New Member
1 0 0

Hello, 

 

I have run into a glitch with my website. The menu button doesn't do anything, it seems clickable, but doesn't respond. Any help would be appreciated!

 

Thediscoveryhut.com


Thanks!

0 Likes
gina-gregory
Shopify Expert
710 47 168

It looks like your theme's javascript is not set up to initialize the code that sets up the click event on that button to do its thing.

0 Likes

Which theme are you using?

1. Download a new fresh copy of whichever theme you are using
2. Copy everything inside the main javascript file (usually named theme.js)
3. Paste it inside your broken theme's theme.js file.

This will replace your broken Javascript with one that works. If you made any customizations in the javascript file they will be overridden. 

Kind regards,
Diego

◦ Problem Solved? ✔️ Please click on Accept as Solution and like.
◦ Tutorials: Minimal theme product pages slideshow | Debut Theme product pages slideshow
◦ Looking to hire an experienced developer? Same day response: ezfycode@gmail.com.
0 Likes
gina-gregory
Shopify Expert
710 47 168

Add this to the bottom of your theme.js.liquid file:

$(document).ready(function() {
  var sections = new theme.Sections();
  sections.register('header-section', theme.HeaderSection);
});

The original Supply theme code registers other sections too, but not sure if they were removed on purpose or not:

 

$(document).ready(function() {
  var sections = new theme.Sections();
  sections.register('collections-list-template', theme.FeaturedCollections);
  sections.register('collection-row-section', theme.CollectionRows);
  sections.register('collection-template', theme.Collection);
  sections.register('header-section', theme.HeaderSection);
  sections.register('list-collections-template', theme.ListCollections);
  sections.register('map-section', theme.Maps);
  sections.register('product-template', theme.Product);
  sections.register('search-template', theme.Search);
  sections.register('slideshow-section', theme.SlideshowSection);
});
0 Likes