Hide zopim chat
RespondidaHi, Zopim! Is it possible to hide live chat on start (now after an invocation of zopim script I see an opened chat window)? Or how can I know when $zopim is ready for using (to call $zopim.livechat.window.hide() )?
ps. I run zopim widget from js file (so, it's not included into html with script tag) and from this script
<!-- Start of perkplate Zendesk Widget script -->...
-
Hi Kiril,
You can use the hideAll API to hide the widget on load: https://api.zopim.com/files/meshim/widget/controllers/LiveChatAPI-js.html#hideAll
You can use setOnConnected to know when $zopim is ready for using https://api.zopim.com/files/meshim/widget/controllers/LiveChatAPI-js.html#setOnConnected
-Ramin
-
Thank you for answer, Ramin.
I'm also wondering, why $zopim.livechat.window.onShow doesn't fire my callback on chat open. But $zopim.livechat.window.onHide works well. -
Can you paste your code with the JS API and email it to support@zendesk.com so they can troubleshoot what is happening?
Could be an issue using it via the Web Widget or not using the script tags. My tests using the native Zopim widget works correctly. Our advocates will be able to diagnose the potential issue once you send the code, URL.
-Ramin
-
I've tested this code in html, but result the same:
<!-- Start of perkplate Zendesk Widget script -->
<script>/*<![CDATA[*/window.zEmbed||function(e,t){var n,o,d,i,s,a=[],r=document.createElement("iframe");window.zEmbed=function(){a.push(arguments)},window.zE=window.zE||window.zEmbed,r.src="javascript:false",r.title="",r.role="presentation",(r.frameElement||r).style.cssText="display: none",d=document.getElementsByTagName("script"),d=d[d.length-1],d.parentNode.insertBefore(r,d),i=r.contentWindow,s=i.document;try{o=s}catch(c){n=document.domain,r.src='javascript:var d=document.open();d.domain="'+n+'";void(0);',o=s}o.open()._l=function(){var o=this.createElement("script");n&&(this.domain=n),o.id="js-iframe-async",o.src=e,this.t=+new Date,this.zendeskHost=t,this.zEQueue=a,this.body.appendChild(o)},o.write('<body onload="document._l();">'),o.close()}("//assets.zendesk.com/embeddable_framework/main.js","perkplate.zendesk.com");
/*]]>*/</script>
<!-- End of perkplate Zendesk Widget script -->
<script>
window.zEmbed(function () {
setTimeout(function () {
window.$zopim(function () {
// This doesn't work for me
window.$zopim.livechat.window.onShow(function () {
//window.$zopim.livechat.window.hide();
console.log('show');
});
// This subscriber works well
window.$zopim.livechat.window.onHide(function () {
//window.$zopim.livechat.window.hide();
console.log('hide');
});
});
});
</script> -
Also I sent this to support.
Iniciar sesión para dejar un comentario.
5 Comentarios