resizable-iframe
Lib to delegate size of an iframe to the parent window.
Install
$ npm install --save resizable-iframe
Build
This repository only includes the CommonJS module.
If you wish to build this library without CommonJS environment run this commands:
npm inpm run buildcd ./dist/
Usage
Below is a example of usage.
Iframe document:
// require itvar ResizableIframe = ; // create a new instance on domready. it will be started automaticallyvar resizableIframe;; // it can be stopped at any type; // and later restarted;
Parent document:
window;
API
new ResizableIframe(options)
Creates new instance of ResizableIframe
.
intervalDuration
type: int
default: 1000
Defines the interval duration of the size check.
nameKey
type: String
default: 'iframeName'
Name of the key with iframe's name value passed to the parent window.
heightKey
type: String
default: 'iframeHeight'
Name of the key with iframe's height value passed to the parent window.
instance.start()
Starts the messaging to the parent window. Automatically called on new instance initialization.
instance.stop()
Stops the messaging to the parent window.