Coder Social home page Coder Social logo

iframe-resizer's Introduction

Iframe Resizer

This iframe resizer uses a script on the external site to give the origin site it's height.
It makes use of HTML5 'postMessage'.

Usage

• Include 'iframe size receiver' on the origin page containing the iframe
• Include 'iframe size giver' on the external page

The 'giver' will listen for clicks of anchor tags and give the height to the 'receiver' on the origin site again.
This is so that accordion/expanding text links will expand the iframe's height correctly.

Feel free to edit the script!

Config

The config for the Iframe Resizer is set in the 'iframe size giver'.

isResponsive: true

This will resize the height of the iframe whenever the window is resized. If the external site is responsive, make sure you set the width of the iframe to 100%!

If the external site is not responsive, set 'isResponsive' to 'false' just to stop unnecessary code from running.

Todo

Add an animationTimer to the config to resize the iframe after any animations used with accordion/expanding text links have finished.

iframe-resizer's People

Contributors

mister-king avatar

Stargazers

 avatar

Watchers

 avatar

Forkers

chriswitko

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.