Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

Version 1 Current »

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');
}

  • No labels