سؤال

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?

هل كانت مفيدة؟

المحلول

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

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

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top