Hello, i'm having trouble with the following:
Note: these effects are pulled from script.aculo.us
I'm trying to make it so when a function is called, it cant be called again until another is finished.
I have two buttons which make one div "slide" down and another "slide" up. Using the following:
var login_session = 0;
function login_down(){
if(login_session == 0){
Effect.BlindDown('struc_sub_login_session');
Effect.BlindDown('struc_sub_login_session', { duration: 1.0});
login_session = 1;
return false;
}
}
function login_up(){
if(login_session == 1){
Effect.BlindUp('struc_sub_login_session');
Effect.BlindUp('struc_sub_login_session', { duration: 1.0});
login_session = 0;
return false;
}
}
However, when the first function is called again the effect doesnt work properly.
The onclick code for each button is as followed:
<a href="#" onclick="login_down();">
<a href="#" onclick="login_up();">
Any help would be much appreciated. Thanks
Note: these effects are pulled from script.aculo.us
I'm trying to make it so when a function is called, it cant be called again until another is finished.
I have two buttons which make one div "slide" down and another "slide" up. Using the following:
var login_session = 0;
function login_down(){
if(login_session == 0){
Effect.BlindDown('struc_sub_login_session');
Effect.BlindDown('struc_sub_login_session', { duration: 1.0});
login_session = 1;
return false;
}
}
function login_up(){
if(login_session == 1){
Effect.BlindUp('struc_sub_login_session');
Effect.BlindUp('struc_sub_login_session', { duration: 1.0});
login_session = 0;
return false;
}
}
However, when the first function is called again the effect doesnt work properly.
The onclick code for each button is as followed:
<a href="#" onclick="login_down();">
<a href="#" onclick="login_up();">
Any help would be much appreciated. Thanks