I've been researching this for a few days and I'm stuck... I read this page:
Resizing an iframe based on content
and this page:
Auto resize iframe height when the height of the iframe contents change (same domain)
It seems it's relatively easy to resize an iframe when the maine index.html that contains the iframes first loads, but once the iframe changes content I can't figure out how to re-size the iframe.
<iframe seamless frameborder="0" name="top" id="top" src="venues.php" width="100%" height="100" /></iframe>
<iframe seamless frameborder="0" name="main" id="main" src="admin.php" width="100%" height="2000" /></iframe>
You could use the
mutation observer event and the
postMessage API, It's very difficult to create and implement script that can negotiate the dimension measurements of an iframe that frequently changes. I gave up on writing something from scratch and used this small plugin:
This Plunker demonstrates the use of this plugin when detecting the
mutation observer event fire when resizing of the iframe happens.