/
Programmatic Control of the Widget

Programmatic Control of the Widget

It is possible to control the Widget programatically by calling the methods open() ,close() and toggle() on the gomeddo-button element.

Do not add/remove CSS classes, as this will bypass the Widget’s internal bookkeeping, resulting in strange behaviour.

Opening the Widget

function openWidget() { const widget = document.querySelector("gomeddo-button"); if (widget) { widget.open(); } }

Closing the Widget

function closeWidget() { const widget = document.querySelector("gomeddo-button"); if (widget) { widget.close(); } }

Toggling the Widget open/close

function toggleWidget() { const widget = document.querySelector("gomeddo-button"); if (widget) { widget.toggle(); } }

Checking if the Widget is open

 

Related content

How to use the GoMeddo Widget on your website
How to use the GoMeddo Widget on your website
More like this
How to setup the Widget for a demo
How to setup the Widget for a demo
More like this
First time Set-up
More like this
GoMeddo Widget FAQ
More like this
GoMeddo Extensions
GoMeddo Extensions
More like this
Widget Web Component
Widget Web Component
More like this