homepage Welcome to WebmasterWorld Guest from
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member

Home / Forums Index / Code, Content, and Presentation / JavaScript and AJAX
Forum Library, Charter, Moderator: open

JavaScript and AJAX Forum

"dynamic" auto resize height of iframe

Msg#: 4335226 posted 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.



WebmasterWorld Senior Member penders us a WebmasterWorld Top Contributor of All Time 5+ Year Member Top Contributors Of The Month

Msg#: 4335226 posted 3:55 pm on Jul 6, 2011 (gmt 0)

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?

Global Options:
 top home search open messages active posts  

Home / Forums Index / Code, Content, and Presentation / JavaScript and AJAX
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved