Skip to main content
Resizing the iframe

Learn how to resize the iframe on your website

Anni avatar
Written by Anni
Updated over a month ago

In some cases, you may wish to resize the iframe (if you use it to embed your schedule into your website) because it shows a scroll bar or has a lot of blank space.

This article covers:


How does the iframe work?

The iframe size is automated using a secure messaging method built into web browsers. This allows your Bookwhen public page (inside the iframe) to communicate its height to your website, ensuring it displays correctly.

How it works:

  • Your Bookwhen public page sends updates about its height.

  • Your website "listens" for these updates.

  • The iframe automatically resizes to match the public page’s dimensions.

Potential limitations:

  • If your website and Bookwhen are on different domains, some browsers may block this communication for security reasons.

  • In these cases, the iframe may not adjust automatically, and you may need to set the height manually.


Resizing script

We provide a JavaScript file that automatically resizes the iframe height whenever the contents change.

To use this, add the following script to your site:

<script src="https://cdn.bookwhen.com/js/iframe_resizer.js"></script>

Important Notes:

  • You’ll need back-end access to your site to add this script.

  • Place the script alongside the iframe code, either in the <head> or <body> elements of your site.

For Web Developers:

For Website Builders (Wix, Squarespace, GoDaddy, etc.):

  • Locate the area where you can add custom scripts or JavaScript to your site.

  • Paste the URL of the JavaScript file in the script section.

If you prefer, you can create your own script to listen for the iframe's size change messages.

💡 Note for Non-Developers

If you're concerned about sending data to Bookwhen, rest assured that nothing happens if your website doesn't "listen" for the messages.

  • Anything that is "sent" but not "listened" for simply goes into a "void."

  • Browsers are designed to automatically discard this data, so there's no need to worry.

Need Help with Wix?


💬 Need extra help?

  • For the quickest response, contact us via live chat on our homepage or your account. Buddy, our trusty chatbot, will assist first and pass you to a support team member if needed.

  • Prefer email? Send us an email instead.

Thank you! 🕺

Did this answer your question?