It appears you have not yet registered with DEVPPL. To register please click here... (it's fast, easy and free!)

Forum

Log In Sponsors
Board index Programming HTML Forum

Hiding and showing frames

Hiding and showing frames

Postby Silver Fox on Mon Nov 20, 2006 10:01 pm

I am wanting to be able to have a row of button, ones that look and act like tabs, but when they are clicked it opens up a new frame on the bottom, then when the next one is selected the frame opens up that new area of the site. Also, when a button labeled hide is clicked it closes the frame. Is this possible? If so how can I do it?

Thanks for any help you can provide,

Silver Fox
Silver Fox
 
Posts: 0
Joined: Mon Nov 20, 2006 10:00 pm

Postby ReFredzRate on Wed Nov 22, 2006 6:51 pm

Dammit... I'll have to think this one over because I know it's possible, but how do I do it... If I can, I will get back on this!
ReFredzRate
1000+ Club
 

Postby ngpgeeta on Sun Nov 26, 2006 1:14 pm

Lets say we have an html page called one.html containing three buttons.

Another page say two.html has some initial information about one.html.

Both pages are in same window but in two frames. The frameset code will be like this:

<HTML>
<HEAD>
</HEAD>
<frameset rows="50,*" border=0>
<frame name="f1" src="one.html">
<frame name="f2" src="two.html">
</frameset>

</HTML>

The code for one.html is say like this:

<HTML>
<HEAD>
<TITLE> New Document </TITLE>
<script>
function change()
{

parent.f2.document.location.href="three.html"
}
function change1()
{

parent.f2.document.location.href="two.html"
}
function change2()
{

parent.f2.document.location.href="four.html"
}
</script>
</HEAD>

<BODY>
<FORM METHOD=POST ACTION="">
<INPUT TYPE="button" name="n1" value=" first" onClick="change()" >
<INPUT TYPE="button" name="n2" value=" second" onClick="change2()" >
<INPUT TYPE="button" name="hide" value="hide" onClick="change1()" >
</FORM>
</BODY>
</HTML>

When button first is pressed, it will open three.html in bottom frame.
When button second is pressed, it will open four.html in bottom frame.
When button hide is pressed, it will open two.html again in the bottom frame. This will give the look as if we have closed three.html or four.html

Hope, this solves your problem.
ngpgeeta
 
Posts: 19
Joined: Sat Nov 18, 2006 11:30 am


Who is online

Users browsing this forum: No registered users and 10 guests