Mobile menu "x" cross button not working

Solved

Mobile menu "x" cross button not working

S29
Shopify Partner
4 0 1

I am using the Ella theme version 6-7-1- on my Shopify store, and I have encountered an issue with the mobile menu functionality.

The close button (represented by an "X") in the mobile menu is not working as expected. While the button is clickable, it does not close the menu. I have tried troubleshooting this issue but haven’t been able to resolve it. Please  Help me.Screenshot (444).pngScreenshot (445).pngScreenshot (446).png

Accepted Solution (1)
Guleria
Shopify Partner
3944 791 1120

This is an accepted solution.

Edit theme.liquid 
 search for </body>

now just before to it add this code


 

<script>
document.addEventListener('DOMContentLoaded', function () {
  // Select all elements with the class 'halo-sidebar-close'
  const closeButtons = document.querySelectorAll('.halo-sidebar-close');
  
  if (closeButtons.length > 0) {
    closeButtons.forEach(button => {
      // Add click event listener to each button
      button.addEventListener('click', function () {
        // Check if the body has the class before removing
        if (document.body.classList.contains('menu_open')) {
          document.body.classList.remove('menu_open');
          console.log('menu_open class removed from body');
        } else {
          console.log('menu_open class not found on body');
        }
      });
    });
  } else {
    console.error('No elements with class "halo-sidebar-close" found');
  }
});

</script>

Regards
Guleria

 

- Drop an email   if you are looking for quick fix or any customization
- Email: guleriathakur43@gmail.com Skype: live:navrocks1
- Try GEMPAGES a great page builder

View solution in original post

Replies 7 (7)

Guleria
Shopify Partner
3944 791 1120

Hello @S29 ,

 

Using Android and Windows it works for me.

Are you checking with IOS ?

btw try to fix the error which appears in the console 
Uncaught type error...

 

 

Regards
Guleria

- Drop an email   if you are looking for quick fix or any customization
- Email: guleriathakur43@gmail.com Skype: live:navrocks1
- Try GEMPAGES a great page builder
S29
Shopify Partner
4 0 1

Can you please go in this URL => https://90408f-2.myshopify.com/
And open in mobile phone. then click on three dots for menu option, then try to click on "x" button.
Its not working even on android and also not in window..
Please help if you know how to solve the issue?

Guleria
Shopify Partner
3944 791 1120

I already took your store URL from screenshots you shared.

And believe me it works fine for me.

I suggest clear the browser cache or check in the incognito window.

 

Regards
Guleria

- Drop an email   if you are looking for quick fix or any customization
- Email: guleriathakur43@gmail.com Skype: live:navrocks1
- Try GEMPAGES a great page builder
S29
Shopify Partner
4 0 1

S29_0-1735047664236.png

This cross (x) button is not working sir. i tried in phone also and in incognito mode also. and my colleague phone also..

 

Guleria
Shopify Partner
3944 791 1120

This is an accepted solution.

Edit theme.liquid 
 search for </body>

now just before to it add this code


 

<script>
document.addEventListener('DOMContentLoaded', function () {
  // Select all elements with the class 'halo-sidebar-close'
  const closeButtons = document.querySelectorAll('.halo-sidebar-close');
  
  if (closeButtons.length > 0) {
    closeButtons.forEach(button => {
      // Add click event listener to each button
      button.addEventListener('click', function () {
        // Check if the body has the class before removing
        if (document.body.classList.contains('menu_open')) {
          document.body.classList.remove('menu_open');
          console.log('menu_open class removed from body');
        } else {
          console.log('menu_open class not found on body');
        }
      });
    });
  } else {
    console.error('No elements with class "halo-sidebar-close" found');
  }
});

</script>

Regards
Guleria

 

- Drop an email   if you are looking for quick fix or any customization
- Email: guleriathakur43@gmail.com Skype: live:navrocks1
- Try GEMPAGES a great page builder
S29
Shopify Partner
4 0 1

Thank you so much. It Works. 🤗

Guleria
Shopify Partner
3944 791 1120

  Great btw don't hesitate to mark the solution accepted and do like the posts  😁

- Drop an email   if you are looking for quick fix or any customization
- Email: guleriathakur43@gmail.com Skype: live:navrocks1
- Try GEMPAGES a great page builder