'Open and close Microsoft Bot Framework

I would like to set up my chat box so visitors can open and close it it as they wish, I am struggling to find the right solution, can anyone help?

Below is the code I have so far:

<div class="chat-popup" id="webchat" role="main" style="height: 30%; width: 15%; margin-top:5%; margin-left:10%"></div>

 

<script src="https://omnireach.net/webchat?key=PbjMaijC3EKXWii/ANCiHQ==" type="text/javascript"></script>

<script>

    window.onload = function() {

        var styleOptions = {

            hideUploadButton: false,
            bubbleFromUserBackground: 'lightblue',
            sendBoxButtonColor: 'red',
            typingAnimationDuration: 5000,
            typingAnimationHeight: 20,
            typingAnimationWidth: 64,
            timestampColor: undefined,
            timestampFormat: 'relative',
            botAvatarImage: 'https://docs.microsoft.com/en-us/azure/bot-service/v4sdk/media/logo_bot.svg?view=azure-bot-service-4.0'

        };

 

        orWebChat.start(styleOptions, "webchat");

    };

</script>


Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source