How to use the iframe-resizer.iframeResize function in iframe-resizer

To help you get started, we’ve selected a few iframe-resizer examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github impress-org / givewp / assets / src / js / plugins / form-template / utils.js View on Github external
export const initializeIframeResize = function( iframe ) {
	return new iframeResize(
		{
			log: false,
			sizeWidth: true,
			checkOrigin: [ window.location.origin ],
			heightCalculationMethod: 'documentElementOffset',
			widthCalculationMethod: 'documentElementOffset',
			onMessage: function( messageData ) {
				let parent = iframe.parentElement;
				if ( iframe.parentElement.classList.contains( 'modal-content' ) ) {
					parent = parent.parentElement.parentElement;
				}

				switch ( messageData.message.action ) {
					case 'giveEmbedFormContentLoaded':

						const timer = setTimeout( function() {

iframe-resizer

Keep same and cross domain iFrames sized to their content with support for window/content resizing, and multiple iFrames.

MIT
Latest version published 15 days ago

Package Health Score

84 / 100
Full package analysis