Skip to toolbar

Community & Business Groups

How to make iFrame resize based on dynamic content each time the content height changes?

Is there any way of making the iframe change its height after the content inside changes?

Example: http://thc-racing.ucoz.com/index/forum/0-14

I’m using easyXDM

Page code:

iFramed page:

Thanks.

One Response to How to make iFrame resize based on dynamic content each time the content height changes?

  • I propose another way to achieve it and hope it helpful. It is easy to implement

    – No need to modify the web page at other server to be used in your iframe.
    – Only need to add some javascript to your web page

    The key points of the proposed method are:
    – Obtain the HTML code of the web page to be used in your iframe via Yahoo’s YQL
    – Create an with attribute src of empty
    – Modify the obtained HTML code by adding ‘base’ tag and adding any javascript you want, e.g. for adjusting iframe’s height
    – Set the iframe’s content to be the modified HTML code.

    Typically, this will have the same content/appearance as the web page at the other server. And more importantly, this is not a cross-domain one, so your script can access anything within the iframe.

    For the details, on-line demo, and sample code, please refer to here
    http://www.share888.info/published/PublishedDoc.asp?id=2

    Reply

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code class="" title="" data-url=""> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong> <pre class="" title="" data-url=""> <span class="" title="" data-url="">

Before you comment here, note that this forum is moderated and your IP address is sent to Akismet, the plugin we use to mitigate spam comments.