Pure JavaScript iFrame Position:fixed Polyfill

Category: Javascript , Layout | October 5, 2018
Author:julianxhokaxhiu
Views Total:2,018 views
Official Page:Go to website
Last Update:October 5, 2018
License:MIT

Preview:

Pure JavaScript iFrame Position:fixed Polyfill

Description:

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'
}

Changelog:

v0.4.3 (10/05/2018)

  • Fix compatibility with Firefox

You Might Be Interested In:


Leave a Reply