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.
4 comments
Shweta
How can I close the web widget when I click anywhere outside that widget?
0
DJ Buenavista Jr.
Hi Shweta,
Thank you for reaching out to Zendesk Support.
In regards to your questions, I believe the following information is available from this article. If you're looking to hide the Web Widget on click, instead of showing it. You can modify/edit the following line id="showWidget" to "hideWidget".
Again, just a disclaimer Zendesk does not support or guarantee the code. Zendesk also can't provide support for third-party technologies such as JavaScript, jQuery, or CSS.
Thank you and have a wonderful day ahead!
Kind regards,
DJ Buenavista Jr. |
Customer Advocacy Specialist
0
raffaello favagrossa
Hi Everyone,
we have a similar need. We would like to be able to open at the click on the link the main page containing all types of ticket form or directly on the ticket form present on the web widget to try to divert in the best way the consumers. We don't understand how to implement the script in order to make the web widget receive the function.
Any suggestions? :)
0
Ram
Hello there Raffaelo, to allow the widget to start with the ticket form or a selection of the ticket form as soon as it has been activated. Your widget settings should only have Contact form enabled. (This means disabling Help Center, Chat Talk). Hope this helps!
0