Problem with Weglot button

Hi… it has been days on a really small problem and getting crazy… so I try to ask for help here…
I would like to hide the weglot button when the menu mobile is open.

I’m working on this page:

the interested elements are:
the sandwich menu: #menu-menu

weglot switch eng/ita: .weglot-container

what I want to achieve:
when #menu-menu has the class .w–open, .weglot-container gets a new class .hidelang

the code I used is the following, I tried many different things (adding css rules, like display:none), or other ones, but nothing, I haven’t kept all the attempt so this is what I have right now


many thanks

forgot to paste the JS

if ($( "#menu-menu" ).hasClass('w--open')) {
$( ".weglot-container" ).addClass( 'hidelang');
} else {
  $( ".weglot-container" ).removeClass( 'hidelang');


You could try this:

$( "#menu-menu" ).click(function(){
  $( ".weglot-container" ).toggleClass( 'hidelang' );


Make sure you add the CSS to head code as well:

.hidelang {
display: none !important;

Let me know how you go!

1 Like