D
daniel
I'm trying to do a simply if else thing but for some reason it doesn't
work. The commented code works - as you can see I'm using jquery but
the problem only happens when I convert the two .click functions into
one with an if.. else statement. The commented section works but i
would like to get the simpler one following working.
/* $("#unsubscribe").hide();
$("#subscribe h4 a").click(function(){
$("#subscribe").hide();
$("#unsubscribe").fadeIn();
return false;
});
$("#unsubscribe h4 a").click(function(){
$("#unsubscribe").hide();
$("#subscribe").fadeIn();
return false;
});*/
$("#unsubscribe").hide();
var formswitch = 0;
$(".left h4 a").click(function(){
if (formswitch == 0) {$("#subscribe").hide();
$("#unsubscribe").fadeIn();
var formswitch = 1;
return false;}
else {$("#unsubscribe").hide();
$("#subscribe").fadeIn();
return false;}
});
work. The commented code works - as you can see I'm using jquery but
the problem only happens when I convert the two .click functions into
one with an if.. else statement. The commented section works but i
would like to get the simpler one following working.
/* $("#unsubscribe").hide();
$("#subscribe h4 a").click(function(){
$("#subscribe").hide();
$("#unsubscribe").fadeIn();
return false;
});
$("#unsubscribe h4 a").click(function(){
$("#unsubscribe").hide();
$("#subscribe").fadeIn();
return false;
});*/
$("#unsubscribe").hide();
var formswitch = 0;
$(".left h4 a").click(function(){
if (formswitch == 0) {$("#subscribe").hide();
$("#unsubscribe").fadeIn();
var formswitch = 1;
return false;}
else {$("#unsubscribe").hide();
$("#subscribe").fadeIn();
return false;}
});