Welcome to WebmasterWorld Guest from

Forum Moderators: open

Message Too Old, No Replies

"dynamic" auto resize height of iframe



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

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.


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

WebmasterWorld Senior Member penders is a WebmasterWorld Top Contributor of All Time 5+ 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?

Featured Threads

Hot Threads This Week

Hot Threads This Month