Hide Web Widget



  • Jacob J Christensen
    Community Moderator

    Hi Sean,

    I'm not to sharp with the embed script these days, but came by a proposed solution to a similar use case from Gab here.

    I hope that helps you out, feel free to come back and share your solution.

  • Thomas Verschoren
    Community Moderator

    Below is a minimal viable product:

    <!-- Start of Zendesk Widget script -->
    <script id="ze-snippet" src="https://static.zdassets.com/ekr/snippet.js?key=123456"> </script>
    <!-- End of Zendesk Widget script -->

    <div id="width"></div>
    <button onclick="zE('webWidget', 'hide')">Show Web Widget</button>

    //print current width to verify if it works
    width = document.getElementById("width");
    width.innerHTML = "width = "+window.innerWidth;

    //check for width and if lower than 600: hide
    if (window.innerWidth <= 600){
    zE('webWidget', 'hide');
    } else {
  • Louise Dissing

    Hi Sean,

    I'd say that you'd be able to create a script that would only initiate the web widget upon load if the screen size is above x px.

    When the screen size is not above the px chosen, you could display a button and check for a click event.

    I hope this helps you - otherwise, let me know and I'll create a script and show you. :-)

    #helpsome regards,
    Louise Dissing
    Team Lead @ helphouse.io


Post is closed for comments.

Powered by Zendesk