multiple actions from one click? (javascript question)

Permabanned
Joined
18 Jun 2008
Posts
24
Location
Cannock
hi :)

if you have a js command on a click:

Code:
onclick="Effect.toggle('divID', 'blind');

is it possible to do two things on that click whereas above it just does the one?

that command toggles the div with id "divID" up and down with a blind animation using the scriptaculous library, but what i would like to be able to do is use just one button to do a blind up command on one thing and a blind down thing on another...

is this possible?
 
Put this within script tags in the page head section:
Code:
function myfunc () {
   Effect.toggle('divID', 'blind');
   alert("command 2");
   alert("command 3 etc etc ");
}

then in your onclick event:
Code:
onclick = "myfunc();"

That is a guess but it should work nicely.
 
alternatively you could do just do the following

onclick="Effect.toggle('divID', 'blind');alert('Yeah BABY');"

basically just stack em up

they will run synchronously.
 
Back
Top Bottom