Support » Plugin: WP Live Chat plugin for WordPress - Tidio » Link to open chat

  • Resolved protesilao

    (@protesilao)


    On my website, I need insert some link to open chat: so, what “class” or “href” I need to use in my links to open chat ?

    P.s for example in zopim chat I use:

    
    <a href="javascript:$zopim.livechat.window.show();">Chat</a>
    
    • This topic was modified 6 months ago by protesilao.
Viewing 1 replies (of 1 total)
  • Plugin Support kamiltidio

    (@kamiltidio)

    Hi!

    Thank you for writing in.
    The function below connected to a button (or any href with onClick() function) will open your chat after clicking on it 🙂

    (function() {
      function onTidioChatApiReady() {
        window.tidioChatApi.hide();
        window.tidioChatApi.on("close", function() {
          window.tidioChatApi.hide();
        });
      }
    
      if (window.tidioChatApi) {
        window.tidioChatApi.on("ready", onTidioChatApiReady);
      } else {
        document.addEventListener("tidioChat-ready", onTidioChatApiReady);
      }
    
      document.querySelector(".chat-button").addEventListener("click", function() {
        window.tidioChatApi.show();
        window.tidioChatApi.open();
      });
    })();
Viewing 1 replies (of 1 total)
  • The topic ‘Link to open chat’ is closed to new replies.