Help with resizing iFrames.

Discussion in 'OT Technology' started by deusexaethera, May 7, 2007.

  1. deusexaethera

    deusexaethera New Member OT Supporter

    Jan 27, 2005
    Likes Received:
    I've got a gov't website that uses a one-row table as a set of "tabs", and clicking on each cell in the table causes an associated iFrame to appear below the "tabs". This is done because the whole website is running in Oracle Portal, and the only viable alternative to using iFrames is to use Oracle's built-in tabs, which require a full-page refresh when switching from one tab to another. No way around it.

    So, what I need to do is to make these iFrames resize themselves to fit their contents when the parent page is loaded. I need to do this because it's impractical to manually change the style="height:###px" property of each iFrame every time something is added or removed from the subpages each iFrame displays.

    I've searched on Google for about ten hours now, trying to find a piece of code that can do this, and everything I've come up with can resize ONE of the iFrames on the parent page, but not ALL of the iFrames -- or if it CAN resize all of the iFrames, it resizes them all to the SAME size, instead of the actual size of each iFrame's contents. So...I need a piece of code that actually works. It can be in any language that runs client-side, though JavaScript is preferred.

    Any ideas?

Share This Page