Change hamburger icons

Change hamburger icons

NOT1
Shopify Partner
195 2 80

I am using Dawn theme and changed the hamburger icon by removing all the deafult code with my custom svg code but when i click it this shows 

NOT1_0-1724499351664.png

Where only cross icon should have been shown but my custom icon is also showing how can i only show the cross icon 

Replies 2 (2)

albertofanini
Tourist
5 0 1

Hi there,

can you share to me the code of your file?

Alberto Fanini - Full Stack Web Developer - Arezzo, IT

Small_Task_Help
Shopify Partner
778 25 69

Hi,

 

Check JavaScript that controls the toggling of the hamburger and cross icons (make sure code hides the custom SVG when the menu is open and shows the cross icon. )

 

Code example

const menuToggle = document.querySelector('.menu-toggle');
const menuIcon = document.querySelector('.menu-icon');
const closeIcon = document.querySelector('.close-icon');

menuToggle.addEventListener('click', () => {
    menuIcon.classList.toggle('hidden');
    closeIcon.classList.toggle('hidden');
});

Use CSS for Adjustment 

To Get Shopify Experts Help, E-mail - hi@ecommercesmalltask.com
About Us - We are Shopify Expert Agency
At Google My Business - Ecommerce Small Task - Hire Shopify Developers Ahmedabad