An IFRAME problem in html file

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
php12342005
Forum Commoner
Posts: 79
Joined: Mon Mar 21, 2005 3:35 am

An IFRAME problem in html file

Post 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]
User avatar
CoderGoblin
DevNet Resident
Posts: 1425
Joined: Tue Mar 16, 2004 10:03 am
Location: Aachen, Germany

Post 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.
User avatar
s.dot
Tranquility In Moderation
Posts: 5001
Joined: Sun Feb 06, 2005 7:18 pm
Location: Indiana

Post 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%">
User avatar
shiznatix
DevNet Master
Posts: 2745
Joined: Tue Dec 28, 2004 5:57 pm
Location: Tallinn, Estonia
Contact:

Post by shiznatix »

i found that mozilla has trouble with the height=100%, try giving it a actual pixel height that seams to work
php12342005
Forum Commoner
Posts: 79
Joined: Mon Mar 21, 2005 3:35 am

Post 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.
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post 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.
Post Reply