1

i'm using Iframe Height Jquery Plugin (Version 1.2.1) to re-size an iframe with dynamic contents.

The iframe re-sizes correctly when it's loaded. Now i got some ui-tabs in the content, with different heights and i want to resize the iframe when a tab is selected.

Calling again jQuery.iframeHeightExternal(); in the iframe content returns only undefined and nothing happens.

Calling again jQuery('#iframe-box').iframeHeight(); in the top-frame resizes correctly. But i need it resizing when the iframe-content changes.

Is this possible anyway?

kidata
  • 165
  • 1
  • 2
  • 15
  • 1
    this [link](http://stackoverflow.com/questions/819416/adjust-width-height-of-iframe-to-fit-with-content-in-it) may be hepful for you. – John Apr 30 '13 at 10:30
  • unfortunately it isn't - it's all about resizing onload which works fine. my problem is to trigger the resizing from inside the iframe. – kidata Apr 30 '13 at 10:38
  • Quite simple and working solution ist this: http://codecopy.wordpress.com/2013/02/22/ghost-iframe-crossdomain-iframe-resize/ – kidata Apr 30 '13 at 12:45

1 Answers1

2

Try this library instead. It uses mutationObserver in the iFrame to pick up changes to the content.

https://github.com/davidjbradshaw/iframe-resizer

David Bradshaw
  • 11,859
  • 3
  • 41
  • 70