Click to See Complete Forum and Search --> : change 2 frames at once with a link


Pir
01-28-2003, 02:12 PM
Hi,

I would like to change two frames with one click. I only found out how Joe on HTMLGoodies did it. He used a form and a button, but I want to do it with a link:

<a class="2" href="home.html" target="main">Home</a>

and I want to be able to influce the appearance of the link with a css.

This is the code I found if I wanted a button :

<FORM>
<INPUT TYPE="button" Value="Change Two Frames at Once"
onClick="parent.frames[2].location='foto.html';
parent.frames[3].location='menufoto.html';">
</FORM>

Is there a possibility to adapt the code or use any different code to realize the chage of 2 frames at once.

Thanks for your reply
Pir

swon
01-28-2003, 02:24 PM
you can do something like that:

<script language=javascript>
function change(frameName,url)
{
var t = parent.[frameNumber];
t.self.location.href=url;
}
</script>
<a href="test.html" target="main" onClick="change('1','test2.html')">test</a>

Pir
01-28-2003, 03:26 PM
Thank you for your reply, but I don't know so much about JavaScript. Could you tell me how I include a second frame. I don't really get the syntax:

It should look like this:
The link:
<a class="2" href="home.html" target="main">Home</a>

in frame nr.2 it should open foto.html
in frame nr.3 it should open fotomenu.html

Thanks
Pir

PS: target=main(=2 frame), so I guess I will have to take that one out of the a href,won't I