Last active
October 3, 2021 06:43
-
-
Save NilsDannemann/c2f56f8fc3da3ba5f8ee2e294f7f3895 to your computer and use it in GitHub Desktop.
Trigger Plutio Chat on Button Click
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script> | |
//Button Code: <button class="plutio-open-chat">Open Chat</div> | |
//Find all Chat Buttons on the Page | |
var plutioChatButtons = document.querySelectorAll('.plutio-open-chat'); | |
//Trigger Open-Chat when one of them is clicked | |
for (var i = 0; i < plutioChatButtons.length; i++) { | |
plutioChatButtons[i].addEventListener('click', function() { | |
event.preventDefault(); | |
$plutio_msg.open(); | |
}); | |
} | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment