Hide Web Widget | Community
Skip to main content

Hide Web Widget

  • September 11, 2019
  • 2 replies
  • 0 views

I'm trying to hide the Web Widget on mobile and use a button to open it

<a href="javascript:$zopim.livechat.window.show();">Help</a>

The script is as follows:

 <script>
var script = document.createElement('script');
script.id = 'ze-snippet';
script.src = 'https://static.zdassets.com/ekr/snippet.js?key=cheesecake';
document.head.appendChild(script);


if ($(window).width() < 600) {
<-- Code to hide here -->
}

I've tried:

(1)
window.zESettings = {
webWidget: {
chat: {
suppress: true
},
}
};

(2)
zE(function() {
zE.hide();
});

(3)
$zopim(function() {
$zopim.livechat.button.hide();
});

It must be possible, as create a link with the below, hides it as desired.

<a href="javascript:$zopim.livechat.window.hide();">Hide</a>
This topic has been closed for replies.

2 replies

Jacob20
  • September 17, 2019

Hi Sean,

I'm not to sharp with the embed script these days, but came by a proposed solution to a similar use case from Gab here.

I hope that helps you out, feel free to come back and share your solution.


  • September 18, 2019

Hi Sean,

I'd say that you'd be able to create a script that would only initiate the web widget upon load if the screen size is above x px.

When the screen size is not above the px chosen, you could display a button and check for a click event.

I hope this helps you - otherwise, let me know and I'll create a script and show you. :-)

#helpsome regards,
Louise Dissing
Team Lead @ helphouse.io