PDA

View Full Version : How to make iframe automatically adjust height...



Clone Dad
Mar 1st, 2010, 02:35 AM
Hello.
I have a flash header on my page with links. When each link is pressed, the appropriate .html page is loaded into the iframe, which i have defined with this code:

Code:


<iframe name = "mainframe" src="home.html"
width="746" height="800"
frameborder="0"
align="middle">

The problem is, the different pages that will be loaded into 'mainframe' have different heights, and i would like the iframe to adjust to these heights without adding scrolling bars.

How would I do this?

_Aerospace_Eng_
Mar 1st, 2010, 02:54 AM
You could use the script here: http://dynamicdrive.com/dynamicindex17/iframessi2.htm

Another option is this one: http://dynamicdrive.com/dynamicindex17/ajaxincludes.htm

But then I guess the real question would be why the use of iframes at all? Why can't you just make separate pages? Is it because you don't want to have to edit the html for each page?

Clone Dad
Mar 1st, 2010, 03:22 AM
I can't use separate pages because i don't want the flash file to reload, because it has a video playing in it, and i don't want that video to reload and start over each time.