Skip to content

Introduction

The iframe-resizer library aims to take away the pain points with using iframes. It will resize your iframe to match the exact size of your content and then monitor the iframe to ensure that it is always the perfect size.

Reliable Resizing

Modern browsers still do not provide a single consistently reliable method to calculate page content size. To overcome this limitation, iframe-resizer automatically inspects your page and selects the best value for your content every time it detects something changed in the page.

The iframe size is calculated using a range of browser values and when necessary it falls back to using iframe-resizer’s own custom content size detection algorithm.

High Performance

To ensure minimal impact on your site, iframe-resizer is highly optimised and utilizes Set Theory to ensure it only checks the page elements that effect the sizing of your iframes.

Even on the most complex pages, iframe-resizer can detect changes to both HTML and CSS, calculate the revised content dimensions and update the iframe in sub millisecond time.

Cross Domain

Supports both internal (same-domain) and external (cross-domain) iframes via a simple JS file that is designed to be a zero impact guest on the sites hosting it.

Extended API

Additionally iframe-resizer provides a range of missing browser API features, that allows you to securely integrate your iframe content with the parent page.

When combined with viewer.js it can even resize iframes containing PDF and ODF documents.

Version 5

This version of iframe-resizer has been extensively rewritten to use modern browser APIs, this has enabled significantly better performance and greater accuracy in the detection of content resizing events.

With this release, the opportunity has been taken to refresh and simplify the API, if you are coming from a previous version then their is an Upgrade Guide to explain the changes.

Was this page useful?