Getting started
This library allows you to automatically resize iframes based on their content sizes. It prevents scrollbars from appearing in your iframe and enhances the user experience.
Setup
Browser (ES6 Modules)
<script type="module"> import { initialize } from "https://cdn.jsdelivr.net/npm/@open-iframe-resizer/core@v1.3.0/dist/index.min.js";
initialize({}, "#my-iframe");</script>
Example
You need to call the initialize
function in the page that host the iframe(s) you want to resize:
Package
Note you can also install the core package through your favorite package tool:
npm install @open-iframe-resizer/core
Further reading
- Explore the settings