Help to hide wix Chat on some pages

Hello everyone and Happy New Year to you all. I’m creating my website on wix.

My problem is: I would like the wix chat to be visible only on some pages of my site. I tried to code with corvix but It only works on Desktop with fallow code:

$w.onReady( function (){
// Hides the element when the page loads
$w(“#WixChat1”).hide();
})

I need to make it work on the Mobile Version as well.
If someone has the solution it would help me a lot.

Thank you very much

Hi,
the code doesn’t work on mobile because Wix chat is a part of the quick action bar and therefore has a different id.


Also, note that you can’t hide it in the mobile version, however, you can collapse it:

$w('#quickActionBar1').collapse();

Following on from Aleks, your original code in your post needs to have a lowercase w for the wixChat1 element id name and you are missing the semi colon from the end of your code too.

$w.onReady(function(){
$w("#wixChat1").hide();
});

Also as this Wix app is setup to appear on all pages, then if you setup code on one page to hide it, then it will be hidden on all other pages too. You would then need to have on your other pages a simple code to have your Wix Chat app set to show again.

$w.onReady(function(){
$w("#wixChat1").show();
});

The easiest way to do this is to put the show function in the site tab so that it applies to all your pages and then just have the hide function on the page tab that you need.

For more info about Wix Chat and Quick Action Bar in Wix API Reference see here.

Finally, if you want to code something that works on a certain device or certain devices only out of desktop, tablet or mobile, then look at using Wix Window API and the formFactor function.

Thank you so much for your Help! It works perfectly <3

does this feature is disabled with 2020 update?
i alsways got error “not a valid selector” if try to hide or show WixChat based on logged user.
any helps? many thanks

Hello,

Does anyone know whether its still possible to perform this as its been some time since this discussion?