Forum Moderators: open

Message Too Old, No Replies

"dynamic" auto resize height of iframe

         

Overspeed

3:48 pm on Jul 5, 2011 (gmt 0)

10+ Year Member



I am looking for a way to "dynamically" resize the height of an iframe based on the content it renders. Now, I have found a number of scripts online, as well as in this forum that address this sort of thing. My needs however are a little dirrerent.

The iframe I am using has a form in it. My problem is when the form inside the iframe is submitted, and the resulting content is much larger in height (a longer page), I would need the iframe to resize its height to match the new size of the content (after form submission).

I have found scripts that will initially size the iframe height on page load to the size needed of the form, but I cant seem to find a script that will "watch" the iframe and resize it dynamically as its contents change.

Is this possible? Many thanx.

penders

3:55 pm on Jul 6, 2011 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



If you already have a script that performs the required action on page load then you could perhaps attach this to a timer event in the parent that 'watches' the iframe? I'm not aware of a change event on the iframe that would be triggered in the event that the iframes content dynamically changes, unless the source of the iframe itself is changed?