Question
How do I show the Web Widget (Classic) on click?
Answer
You can use Web Widget (Classic) Javascript API for the Web Widget (Classic) to hide or show on click.
- Go to Admin Center, then navigate to the Web Widget page.
- Verify the widget is customized to show the desired Support features.
- Copy the widget code from the Setup tab.
- Navigate to the page where the widget should appear.
- Paste the widget code in the header or footer of the page.
- In JS section of page code, enter the zE.hide method after the
$(document).ready(function
$(document).ready(function() {
<script> zE(function()
{zE.hide();});
</script>}
- Enter the zE.show method to have the widget show when the customer clicks the custom text or an image.
<a href="javascript:void(0);" id="showWidget" onclick="zE(function() {zE.show();});">Your text here</a>
Find more examples of how you can leverage these API methods in this article: Advanced customization of the Web Widget (Classic).
Disclaimer: This article is provided for instructional purposes only. Zendesk does not support or guarantee the code. Zendesk also can't provide support for third-party technologies such as JavaScript, jQuery, or CSS. Post any issues you have in the comments section or try searching for a solution online.