Click to See Complete Forum and Search --> : [RESOLVED] How to hide a fame form a onLoad event


benzino
04-12-2006, 04:58 PM
Hi, i'm back again, this time with a harder question. i have searched the forums but i haven't found a solution for this problem that will work with me.

What i want to do is hide the frame named Subcart when a particular page (ShoppingCart.html) is loaded up in the main frame. I only want it to work on IE.

This is the Framset page (the top page), (sorry about indent):

<frameset rows="25%, 55%, *" frameborder="0" border="0" framespacing="0">
<frame name="topFrame" scrolling="no" noresize src="pages/logo.htm">
<frameset cols="190,*" frameborder="" border="" framespacing="2">
<frameset>
<frame scrolling="NO" src="pages/nav.htm" noresize>
<frame name="main" src="pages/liverpool.html">
</frameset>
<frame name="Subcart" src="pages/Subcart.html" scrolling="YES">
</frameset>
</frameset>

This is the hide page function in the ShoppingCart.html page:

function loadform()
{
//parent.myFrameset.cols="0%";
top.hideFrame("Subcart");
//top.hideFrame("Subcart.html");
//top.Subcart.rows = "0%";
}

As you can see i have tried different methods (the syntax is most likey wrong, i just looked around on different sites., but all in vain. I thought the top.hideFrame("Subcart"); would work but i get an error saying Object doesn't support this property or method

Any suggestions?

Thanks in advance.

Natdrip
04-12-2006, 07:45 PM
hi there

<span id="frameCont" style="visibility:visible;">
your frameset1
</span>

on some action
document.getElementById('frameCont').style.visibility='hidden'>

hope this helps

benzino
04-13-2006, 08:13 AM
Hi,

I tried that but it didn't work, I kept getting an error saying object required. Although I did assume that the ">" was a typing error and replaced it with a ";".

Thanks for your help though.

benzino
04-13-2006, 11:33 AM
Just got it. Instead of hiding the frame, i should just reduce it's size to 0.

I did this by naming my first frameset as "first", as follows:

<frameset name ="first" rows="25%, 55%, *" frameborder="0" border="0" framespacing="0">
<frame name="topFrame" scrolling="no" noresize src="pages/logo.htm">
<frameset cols="190,*" frameborder="" border="" framespacing="2">
<frameset>
<frame scrolling="NO" src="pages/nav.htm" noresize>
<frame name="main" src="pages/liverpool.html">
</frameset>
<frame name="Subcart" src="pages/Subcart.html" scrolling="YES">
</frameset>
</frameset>

Then the following line reduces it's size to 0%:

top.first.rows="25%, 75%, *";

Thanks Natdrip for your help