How to use the iframe-resizer.iframeResizer 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 frctl / fractalite / packages / themes / styleguide / assets / styleguide.js View on Github external
import './styleguide.scss';
import { iframeResizer } from 'iframe-resizer';
// import * as hljs from 'highlightjs';
import $ from 'jquery';

const iframes = iframeResizer();
// hljs.initHighlightingOnLoad();

const variants = $('.variant');

if (variants.length) {
  variants.each(function() {
    const variant = $(this);
    const toggles = variant.find('.variant__toggle');
    const panels = variant.find('.variant__panel');
    toggles.on('click', function() {
      iframes.forEach(iframe => iframe.iFrameResizer.resize());
      const toggle = $(this);
      const target = variant.find(toggle.attr('href'));
      toggles.removeClass('is-active');
      toggle.addClass('is-active');
github devguides-io / devguides-2016 / assets / script.js View on Github external
$(document).on('pages:advance pages:rewind', '.page-section', function (e, options) {
  var $pagedots = $('.page-dots')
  var $dots = $pagedots.children()
  $dots.removeClass('-active')
  $pagedots.toggleClass('-hide', options.index === 0)

  // Never select the first dot.
  $dots.eq(Math.max(options.index, 1)).addClass('-active')
})

/*
 * iframe
 */

var iFrameResize = require('iframe-resizer')
iFrameResize.iframeResizer({
  resizedCallback: function () {
    $(window).trigger('resize')
  }
}, 'iframe[seamless]')

/*
 * On hash change
 */

void (function () {
  $(window).on('hashchange', onHashChange)
  $(document).on('click', 'a[href^="#"]', onClick)

  function onHashChange (e) {
    navigateToHash(window.location.hash)
  }
github joincivil / Civil / packages / sdk / src / react / boosts / BoostEmbedIframe.tsx View on Github external
const setUpIframeResizer = (el: HTMLIFrameElement | null, initialHeight: string) => {
    if (el) {
      setHeightImportant(el, initialHeight);
      if (isIframeSetUp) {
        return;
      }
      iframeResizer(
        {
          heightCalculationMethod: "taggedElement", // looks for elements with `data-iframe-height` attribute and resizes to fit them
          tolerance: 25,

          // @ts-ignore iframe-resizer types are missing the event handlers and some other options
          warningTimeout: 20000,
          // @ts-ignore
          onResized: ({ iframe, height }: { iframe: HTMLIFrameElement; height: string }) => {
            setIframeHeight(parseInt(height, 10) + 20 + "px");
          },
          // @ts-ignore
          onInit: () => {
            setIsLoaded(true);
          },
        },
        el,
github DefinitelyTyped / DefinitelyTyped / types / iframe-resizer / iframe-resizer-tests.ts View on Github external
function testTwo(): void {
  const iframe: HTMLIFrameElement = document.createElement('iframe');
  const components: iframeResizer.IFrameComponent[] = iframeResizer({
    initCallback: () => {
      console.log('Init');
    },
    closedCallback: () => {
      console.log('Closed');
    }
  }, iframe);
  if (components) {
    components.forEach(component => console.log(component.iFrameResizer));
  } else {
    console.log("No components");
  }
}
github DefinitelyTyped / DefinitelyTyped / types / iframe-resizer / iframe-resizer-tests.ts View on Github external
function testOne(): void {
  const iframe: HTMLIFrameElement = document.createElement('iframe');
  const options: iframeResizer.IFrameOptions = { log: true };
  const components: iframeResizer.IFrameComponent[] = iframeResizer(options, iframe);
  if (components) {
    components.forEach(component => console.log(component.iFrameResizer));
  } else {
    console.log("No components");
  }
}
github podlove / podlove-ui / apps / web-player / src / player / index.js View on Github external
template: target.template,
    resizer: iframeResizerContentWindow,
    loader: createLoader(config)
  })

  const player = await sandbox(target.node, playerDom)
    .then(
      setStyles({
        transition: 'all 500ms'
      })
    )
    .then(resize(target.node))

  setAccessibilityAttributes(config, player)

  iframeResizer(
    {
      checkOrigin: false,
      log: false
    },
    player
  )

  const store = prop('PODLOVE_STORE', sandboxWindow(player))

  return store
}
github zeroasterisk / react-iframe-resizer-super / src / index.js View on Github external
resizeIframe = (props) => {
    const frame = this.refs.frame;
    if (!frame) return;
    if (props.iframeResizerEnable) {
      iframeResizerLib(props.iframeResizerOptions, frame);
    }
  }
  render() {
github patternplate / patternplate / components / legacy / src / widgets / component-demo / index.js View on Github external
componentDidMount() {
    if (this.ref && !this.resizer) {
      resizer.iframeResizer({
        warningTimeout: 0,
        log: false
      }, this.ref);
    }
  }

iframe-resizer

This project has now been split into two separate packages. Please use '@iframe-resizer/parent' and '@iframe-resizer/child'. See https://iframe-resizer.com/upgrade for more details.

GPL-3.0
Latest version published 1 month ago

Package Health Score

91 / 100
Full package analysis