Pure JavaScript iFrame Position:fixed Polyfill

Category: Javascript , Layout | October 5, 2018
Views Total:2,125 views
Official Page:Go to website
Last Update:October 5, 2018


Pure JavaScript iFrame Position:fixed Polyfill


A native JavaScript iFrame position:fixed polyfill that keeps iframe content fixed on the screen when page scrolling.

Install the iFrame Position:fixed Polyfill:

$ npm install iframe-position-fixed-polyfill

How to use it:

Import the iframe-position-fixed-polyfill into your web project.

import iFramePositionFixPolyfill from 'iframe-position-fixed-polyfill'

Or directly include the polyfill in your document as this:

<script src="src/polyfill.js"></script>

That’s it. There are some useful options to config the iFrame position:fixed polyfill.

window.iFramePositionFixPolyfillConfiguration = {
  debug: false,
  parent: window.parent,
  parentScrollTopProperty: 'pageYOffset'


v0.4.3 (10/05/2018)

  • Fix compatibility with Firefox

You Might Be Interested In:

Leave a Reply