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


Pir
01-29-2003, 01:52 AM
Hi,
I would like to change 2 frames with one click on a link. I was suggested to use the following code


<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>

but I don't know a lot about JavaScript and that's why I don't really know how to expand the code for two frames.

I would like to look it something 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

Could someone please show me how the code should look like incorporating the above frames and .html.

Thanks a lot
Pir

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

Nicodemas
01-29-2003, 05:11 AM
Probably not the most efficient idea, because I'm half asleep...

why not when they click that link, you send them to another page that has the framsets specified in it? Instead of changing the frames source, just send them to a new page.

Like this:
User A clicks your "Home" button. This link sends them to home.html where you have this code:

<FRAMESET ... >
<FRAME SRC="XXXXXXX.html">
<FRAME SRC="XXXXXXX.html">
</FRAMESET>

You know what I mean? That would "change" the framesets they see.

Just a thought. To bed I go!

Charles
01-29-2003, 05:19 AM
Originally posted by Nicodemas
Probably not the most efficient idea, because I'm half asleep...No, that is the most efficient idea. Any JavaScript method will fail one in ten times.

Pir
01-29-2003, 10:42 AM
but then if I have 5 links that change 2 frames at once I will have to have 5 differen "index.html" pages, won't i

Pir

jdavia
01-29-2003, 11:47 AM
The answer is Yes, index,index0, index1 and so on.
A demo is attached. It will drive you crazy.

Pir
01-29-2003, 03:52 PM
Thank you very much for your files. I expected it to look something like this. That's why I wanted a JavaScript (also to save loading time). But I guess I have no choice ;-)
I will have a lot of fun redoing my site =)

Once again, thanks to all of you for your help