Page 1 of 1

An IFRAME problem in html file

Posted: Thu Mar 24, 2005 8:05 am
by php12342005
I use an iframe in a html page.
left side is the iframe and code looks like (simplified):

Code: Select all

<table>
<tr>
<td><iframe src=&quote;http://www..../left.html&quote; width=300 height=100%></iframe></td>
<td> multiple text lines of main page .... </td>
</tr>
</table>
when the page is loaded, only part of left frame is displayed vertically.
the reason i guess is that left frame doesn't know actual size of height=100% because left frame is loaded first - the 100% should be the height of main page.

i think i need to add some code inside left.html, is that right? what is that?

could u help me to solve the problem?

(this is not a pure php Q, but all php persons know html).

thanks


feyd | Please review how to post code using

Code: Select all

and

Code: Select all

tags. Read:  [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url][/color]

Posted: Thu Mar 24, 2005 8:19 am
by CoderGoblin
I have never managed to get the iframe height as a percentage working without resorting to javascript to get the Iframe document's size and changing the Iframe height to it. I think this is because the iframe window is drawn/rendered before the iframe document inserted.

Posted: Thu Mar 24, 2005 8:24 am
by s.dot
Seems like you don't need an IFRAME for this

two simple frames would work.

Left and right.

Iframes are used for when you want a frame in the middle of the page (InlineFRAME)

but if for some reason you need an IFRAME there, try changing the table cell containing the iframe to <td height="100%">

Posted: Thu Mar 24, 2005 10:21 am
by shiznatix
i found that mozilla has trouble with the height=100%, try giving it a actual pixel height that seams to work

Posted: Thu Mar 24, 2005 12:12 pm
by php12342005
Hi scrotaye,
i add <td height="100%">, the page looks much better now.

but 2 frames are not a good idea because visitors will have trouble if coming from search engine (only see one frame).

thanks to all.

Posted: Thu Mar 24, 2005 12:22 pm
by feyd
you can add code such that it can detect if the other frame is available, if not, it can redirect the main browser window to the correct page.