Skip to content

Introduction

The iframe-resizer library aims to take away the pain points with using iframes.

In addition to keeping you iframe sized to the content, iframe-resizer also provides the missing browser API features, that allows you to securely integrate your iframe content with the parent page.

  • Scroll the page, relative to the iframe or parent page’s position
  • Get details of the position of the iframe, the scroll position and viewport of the parent page
  • Fixes in page linking in the iframe and allows links to propagate to the parent page
  • Adds onMouseEnter and onMouseLeave events to the iframe element
  • Simplified message passing between the iframe and the parent page
  • Automatic domain authentication

It can also be combined with viewer.js to display PDF and ODF documents in an iframe.

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.