Programmatic Control of the Widget

Open/close the widget

To open or close the widget, send an artificial click event to the widget button. Do not add/remove CSS classes, as this will bypass the widget’s internal bookkeeping, resulting in strange behaviour.

Artificial click event example code

1 2 3 4 5 6 function toggleWidget() { const button = document.querySelector('.booker25widget__btn'); if (button) { button.click(); } }

Check if the widget is open

1 2 3 4 function isWidgetOpen() { const iframe = document.querySelector('.booker25widget__iframe'); return iframe && iframe.classList.contains('booker25widget__iframe--hidden'); }