Get started with iframe-resizer CDN

MIT licensed

Iframe-resizer is a lightweight library that dynamically adjusts the height of an iframe to match its content.

Tags:
  • Cross
  • Domain
  • Cross-Domain
  • iFrame
  • Resizing
  • Resizer
  • postMessage
  • content
  • resize
  • height
  • auto-height
  • iframe-auto-height
  • height-iframe
  • width
  • mutationObserver
  • RWD
  • responsive
  • responsive-iframe
  • jquery-plugin

Stable version

Copied!

How to start using iframe-resizer CDN


<!DOCTYPE html>
<html>
<head>
    <title>Get started with iframe-resizer CDN - cdnhub.io</title>
    <style>
        #content {
            width: 100%;
            height: 500px;
            border: 1px solid black;
        }
    </style>
</head>
<body>
    <div id="content">
        <iframe src="https://example.com" sandbox="allow-scripts allow-same-origin" frameborder="0" loading="lazy" allowfullscreen="true" id="example-iframe" scrolling="no" seamless="seamless" onload="this.height = '100%'; iframeResizer.init(this)"></iframe>
    </div>
    <script src="https://cdn.cdnhub.io/iframe-resizer/4.3.9/iframeResizer.min.js"></script>
    <script>
        if (!window.iframeResizer) {
            throw new Error('Iframe Resizer library failed to load.');
        }
    </script>
</body>
</html>

All versions