house9 / jquery-iframe-auto-height

jQuery plugin to set the height of an iframe to its contents height
https://github.com/house9/jquery-iframe-auto-height
453 stars 211 forks source link

iFrame contents erased after calling iframeAutoHeight #37

Closed adamzochowski closed 12 years ago

adamzochowski commented 12 years ago

Code sample to reproduce

<iframe id=test height=100px width=100px></iframe>
<button onclick="$('#test').contents().find('html').html('adam');"></button>
<button onclick="$('#test').contents().find('html').html('adam<BR><BR><BR>zochowski');"></button>
<button onclick="$('#test').iframeAutoHeight({debug: true});"></button>
house9 commented 12 years ago

the plugin binds to the load event of the iframe, my guess is that updating the html content of the iframe will not fire a load event also its not really meant to be invoked from user action such as clicking a button

house9 commented 12 years ago

I have added a triggerFunctions option to the plugin, so you can pass in click and resize event handlers, see the readme 1.8.0 and up - might help with what you are trying to do?