title: Crisp.chat how to register a callback event (javascript)
body: <p>I am trying to hide/show an element when the chat gets opened or closed.
  I don't understand how I should write the callback function that should trigger.</p>
  
  <p>I want my element <code>$('.customtrigger')</code> to <code>.hide()</code> or <code>.show()</code>.</p>
  
  <p>Documentation from Crisp.chat:
  <a href="https://help.crisp.chat/en/article/how-to-use-dollarcrisp-javascript-sdk-10ud15y/" rel="nofollow noreferrer">Documentation</a></p>
  
  <blockquote>
    <p><strong>chat:opened</strong> - $crisp.push(["on", "chat:opened", callback]) - Handles the chatbox opened event (triggers your callback function)</p>
  </blockquote>
  
  <p>I tried to contact Crisp.chat support but they could not provide examples and didn't understand my question?!</p>
  
  <p>I think it's a simple jQuery question - I just don't understand how I should use it. hmm.</p>