In this guide, we will show you the simple and easy-to-follow steps on how you can show or hide the Chatway icon using Javascript.
This feature is very helpful so you can give the option to your site visitors to chat with you anywhere on your website and hide the icon at any time. You can apply the Javascript function on a button or an image for easy access.
How to show the Chatway icon
To open the Chatway icon using a button click, start by adding a button then add the code below as the link:
javascript:$chatway.showChatwayIcon();
Click below to see how it works:
(if the Chatway icon is currently open, please hide it first by clicking here)
You can also just add the code directly as a link:
How to hide the Chatway icon
To hide the Chatway icon, just follow the same steps above but use the Javascript function below.
javascript:$chatway.hideChatwayIcon();
Click below to see how it works:
If you want to hide the Chatway icon in order to launch the widget through your custom button, you can also use the custom CSS code below:
.chatway--container .chatway--trigger-container {
display: none
}
That’s it! Easy as 1,2,3 ☺️
You can also check this guide on how to open or close the Chatway widget using Javascript here.