Code for hide/show elements depending on the Language DOESN'T work in Mobile site

Hello Everyone!
I would really like your help.
I’ve used this Corvid Tutorial: “Changing the Direction of Menu Tabs Based on the Current Language” to write a code for showing/ hiding different elements on my website depending on the language of the site. It is working well in Desktop.
Unfortunately, when viewing the website in Mobile mode, the elements, of both languages show up.

I put the elements one on top of the other and used this code:

import wixWindow from ‘wix-window’ ;
$w.onReady( function () {
// TODO: write your page related code here…
$w.onReady( function () {
let myLang = wixWindow.multilingual.currentLanguage;
if (myLang === ‘he’ ) {
$w( ‘#gallery2’ ).hide();
$w( ‘#gallery1’ ).show();
} else {
$w( ‘#gallery1’ ).hide();
$w( ‘#gallery2’ ).show();
}
});
});

In Desktop it works, the element that is vissual up is only the ones that are supposed to be seen.
In MOBILE- IT DOESN’T WORK. Both elemtns are visuall.

PLEASE HELP.

Thanks.

1 Like