Skip to main content
Skip table of contents

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

JS
function toggleWidget() {
  const button = document.querySelector('.booker25widget__btn');
  if (button) {
    button.click();
  }
}

Check if the widget is open

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

JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.