PDA

Click to See Complete Forum and Search --> : Frames [resolved]


mrstuff68
Dec 23rd, 2005, 09:29 AM
I have the following code on my page. I have a frame defined in a table and for some reason when the text shows up it doesnt span the entire page, but there is scrolling, I dont want no scrolling on it, i just want the entire page to show up .


<td valign="top" align="center" width="100%">
<Table width="100%" height="100%" cellpadding="0" cellspacing="0" border="0">
<Tr>
<Td height="100%">
<iframe name="main_frame" src="Home.html" width="100%" height="100%" marginwidth="5" marginheight="5" scrolling="no" frameborder="0">
</iframe>
</TD>
</TR>
</TABLE>
</td>

mendhak
Dec 23rd, 2005, 05:48 PM
In the IFRAME's onLoad, do this:



<script language="JavaScript">

function ResizeIframe(){

var getheight = document.getElementById('MyIframe').contentWindow.document.body.scrollHeight;
document.getElementById('MyIframe').height= getheight;
}

</script>

<iframe name="MyIframe" id="MyIframe" src="Home.html" width="100%" height="100%" marginwidth="5" marginheight="5" scrolling="no" frameborder="0" onLoad="ResizeIframe();">
</iframe>

mrstuff68
Dec 23rd, 2005, 06:10 PM
Mendak, the code that you provided me works fine in IE but not in firefox. It loads correctly but when I click on another link to load in that frame, if the next loading page is bigger it changes correctly but when its smaller, it leave the previous height of the frame.

Any ideas on this

mrstuff68
Jan 5th, 2006, 02:17 PM
Im bouncing this to the top, just to see if anyone has a solution to this.

mendhak
Jan 6th, 2006, 08:57 AM
Instead of

document.getElementById('MyIframe').height= getheight;

try

document.getElementById('MyIframe').style.height= getheight;

That should work in FF too

mrstuff68
Jan 6th, 2006, 09:42 AM
mendhak, with the new code it works fine in IE but still doesnt work in FF.

mendhak
Jan 7th, 2006, 08:50 AM
Can you upload your page here in ZIP format, I'd like to run it on my machine.

mrstuff68
Jan 9th, 2006, 02:18 PM
Mendhak,

Attached is the site and a few links. Open the index.html in Firefox, you will see Welcome to our site in the frame. then click on calculators on the left hand side, you will see that Fitness Calculators heading is not at the top like Welcome but lower. This is the issue that i am talking about in this post. Also when you load the page let me know if you style sheet kicks in the the headings are in a thick font or are they time new roman.

Thanks

mrstuff68
Jan 13th, 2006, 10:04 PM
Mendhak, Did you get a chance to look at the code that I posted? Do you have any suggestions concerning a fix.

mrstuff68
Jan 24th, 2006, 12:59 PM
Does anyone have any ideas on how I can resolve this issue that I am having. Files are attached in a previous posting.

mrstuff68
Jan 25th, 2006, 04:42 PM
Mind I remind you that it works fine in opera and in IE. It just doesnt want to resize in Firefox.

penagate
Jan 26th, 2006, 02:43 AM
Heavens man, that is some terrifying code :eek2:

You should never need to nest tables like that. Use them sparingly, and certainly not for layout.

For me, it seems to work OK, but I'm not sure what you're trying to do, so can you explain the purpose of it a little more?

mendhak
Jan 26th, 2006, 04:36 AM
Sorry I missed this thread. I can't determine the problem though.

mrstuff68
Jan 27th, 2006, 09:29 AM
I managed to track down the problem, i was missing <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN" "http://www.w3.org/TR/html4/frameset.dtd"> on the page.