Click to See Complete Forum and Search --> : Multiple events, one HREF...


stmasi
06-03-2003, 09:46 AM
Is there any way to make two different events occur in two different iframes using only one HREF to activate them?

Thanx.

gil davis
06-03-2003, 10:37 AM
You don't "make two different events occur".

If you mean two different reactions to an event, the answer is "yes". You can place as many lines of code as necessary in the event handler, just separate each statement with a ";". For example:
<a href="..." onclick="doThis();doThat();doAnother();return false">

stmasi
06-03-2003, 12:15 PM
Cool.

So how would I define multiple targets?

<a href="event1.html" target="area1" "event2.html" target="area2">

Thanx.

pyro
06-03-2003, 12:46 PM
I think you are going to have to do something like this:

<a href="event1.html" onclick="top.area1.location.href=this.href; top.area2.location.href=this.href;">

MrPunkin
06-04-2003, 03:36 PM
please fill in a little more detail. Im looking to do this too.

pyro
06-04-2003, 05:15 PM
Ok, to change two frames locations:

<html>
<head>
</head>
<body>
<a href="http://www.yahoo.com" onclick="top.area1.location.href=this.href; top.area2.location.href=this.href; return false;">test</a>
</body>
</html>
Where area1 and area2 are the names of the frames you want to change the location of.