Change hamburger menu to x when open

I’ve used the search but couldn’t find a thread that helped me.

On smaller viewports/mobile a menu button with hamburger icon is shown. When the submenu is opened, I’d like the button to display the text ‘Close X’ (it doesn’t need to be animated) instead of ‘Menu + hamburger icon’.

So I’m looking for these 2 options:
Menu closed: Menu + hamburger icon
Menu open: Close + X icon

Your help is much appreciated!

Hi,

To achieve that, you can add this in Theme Options > CSS


.x-btn-navbar .x-icon-bars:before{
     content: "\f00d";  
}

.x-btn-navbar.collapsed .x-icon-bars:before {
     content: "\f0c9";
}

Hope this helps.

1 Like

I adjusted the code a bit and now it works like I wanted. Thank you!

Glad we could help.

Cheers!

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.