Size cross domain iFrames to content with support for window/content resizing, and multiple iFrames. This library enables the automatic resizing of the height and width of both same and cross domain iFrames to fit their contained content. It provides a range of features to address the most common issues with using iFrames. Provides a range of page size calculation methods to support complex CSS layouts. Detects changes to the DOM that can cause the page to resize using MutationObserver. Detects events that can cause the page to resize (window resize, CSS animation and transition, orientation change and mouse events). Fixes in page links in iFrame and supports links between the iFrame and parent page. Works with ViewerJS to support PDF and ODF documents. The package contains two minified JavaScript files in the js folder. The first (iframeResizer.min.js) is for the page hosting the iFrames.
Features
- Height and width resizing of the iFrame to content size
- Works with multiple and nested iFrames
- Domain authentication for cross domain iFrames
- Simplified messaging between iFrame and host page via postMessage
- Provides custom sizing and scrolling methods
- Exposes parent position and viewport size to the iFrame