Fixing Scroll + Load Conflicts With Embedded Iframes

If you’ve ever embedded an iframe into your Webflow page, whether it’s a video, widget, or external booking engine, you may have noticed some strange behavior:

Read time:
2 minutes
Author:
Bojana Djakovic
Published:
July 25, 2025

If you’ve ever embedded an iframe into your Webflow page, whether it’s a video, widget, or external booking engine, you may have noticed some strange behavior:

  • Page scrolling jumps when the iframe loads
  • iframe causes layout to shift on mobile devices
  • Scrolling animations move or get blocked near the iframe

These scrolling and loading conflicts with embedded iframes can hurt the user experience and page speed, especially on single-page designs with smooth scrolling or parallax effects.

In this post, I will show you how I solved these problems on Webflow, using a few simple techniques that work with most embedding scenarios.

The problem with iframes and scrolling

Iframes act like mini web pages inside your page.

  1. Dynamically resize (especially forms, booking systems, or maps)
  2. Inject scripts that block smooth scrolling
  3. Initiate layout scrolling if not sized properly

This often causes:

  1. Jumping scroll position when iframe content loads
  2. Issues with CLS (cumulative layout scrolling)
  3. Stuck scroll-based animations

Solution 1: Set a fixed width and height for the iframe


Don’t rely on automatic sizing or percentage height.
Set a fixed width and height for your iframe based on the expected content.

<iframe src="https://external-site.com" width="100%" height="600" style="border:none;"></iframe>

  • This prevents the layout from shifting when the iframe loads
  • Prevents iframes from collapsing on mobile devices

Solution 2:Use a wrapper Div with hidden overflow

Wrap your iframe inside a div block and apply these styles:

  • Position: relative
  • Overflow: hidden
  • Fixed height
.iframe-wrapper {
position: relative;
overflow: hidden;
height: 600px;
}

Place the iframe inside this wrapper.

  • This contains unexpected excess or scroll bars
  • Prevents the iframe from affecting other page elements

Solution 3:Lazy loading the iframe

If the iframe is far down the page, lazily load it using JavaScript or the native loading="lazy" attribute.

<iframe src="https://external-site.com" width="100%" height="600" loading="lazy" style="border:none;"></iframe>

  • This prevents the iframe from blocking the initial page load
  • Helps reduce layout scrolling when rendering the page

Solution 4:Disable cursor events on scroll

Some embedded iframes (such as Google Maps) can catch scrolling and block page scrolling when the user reaches them.

iframe {
pointer-events: none;
}

Enable pointer events again on click if necessary (using JavaScript).

  • Prevents scroll hijacking on mobile devices
  • Common fix for embedded maps

Solution 5:Delay iframe loading with JavaScript

If your iframe is causing severe script conflicts, load it only when needed (e.g. when it enters the viewport).

Simple example with Intersection Observer:

document.addEventListener("DOMContentLoaded", function() {
let iframe = document.querySelector('#lazy-iframe');
let observer = new IntersectionObserver(entries => {
entries.forEach(entry => {
if(entry.isIntersecting){
iframe.src = iframe.dataset.src;
observer.unobserve(iframe);
}
});
});
observer.observe(iframe);
});
<iframe id="lazy-iframe" data-src="https://external-site.com" width="100%" height="600" style="border:none;"></iframe>
  • Only loads when the user scrolls to it
  • Reduces script conflicts and scrolling errors

Iframes are useful but can easily disrupt the flow of your Webflow site if not handled carefully.

My recommended checklist:

  1. Always set a fixed height and width
  2. Wrap in a div with controlled styles
  3. Use lazy loading
  4. Watch for pointer events
  5. Delay loading if necessary
Back to blog page