Hide Web Widget

답변함

3 댓글

  • Jacob J Christensen
    댓글 작업 고유 링크

    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.

    0
  • Thomas Verschoren
    댓글 작업 고유 링크

    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>

    <script>
    //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');
    console.log('hidden');
    } else {
    console.log('show')
    }
    </script>
    1
  • 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

    0

댓글을 남기려면 로그인하세요.

Zendesk 제공