Hide zopim chat

답변함

5 댓글

  • Ramin Shokrizadeh
    Zendesk Product Manager

    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

    1
  • Kiril Makarchuk

    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.

    0
  • Ramin Shokrizadeh
    Zendesk Product Manager

    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

    0
  • Kiril Makarchuk

    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>
    0
  • Kiril Makarchuk

    Also I sent this to support.

    0

댓글을 남기려면 로그인하세요.

Zendesk 제공