Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <script>
- GorgiasChat.init().then(function() {
- GorgiasChat.on('ready', function(){
- var chatButtonIframe = document.querySelector('#chat-button');
- chatButtonIframe.style="display:none;"
- // replace our button with your own
- var myButton = document.createElement('button');
- myButton.style = `
- position: fixed;
- right: 22px;
- bottom: 10px;
- z-index: 2147483000;
- width: 50px;
- height: 50px;
- border-radius: 10px;
- background-color: blue;
- display: none;
- `
- // onClick, behave like a chat opener
- myButton.onclick = function(){
- if (GorgiasChat.isOpen()) {
- GorgiasChat.close();
- } else {
- GorgiasChat.open();
- }
- }
- document.body.appendChild(myButton);
- });
- })
- </script>
- <script>
- GorgiasChat.init().then(function() {
- GorgiasChat.on('widget:opened', () => {
- document.querySelector('#gorgias-chat-container iframe#chat-button').style.display = 'block'
- })
- GorgiasChat.on('widget:closed', () => {
- document.querySelector('#gorgias-chat-container iframe#chat-button').style.display = 'none'
- })
- })
- </script>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement