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
function toggleWidget() {
const button = document.querySelector('.booker25widget__btn');
if (button) {
button.click();
}
}
Check if the widget is open
function isWidgetOpen() {
const iframe = document.querySelector('.booker25widget__iframe');
return iframe && iframe.classList.contains('booker25widget__iframe--hidden');
}