I am trying to teach myself basic jquery and am having problems with the if statement that I am trying to use. My code is as follows:
var animate = 0;
$('a').click(function () {
if (animate == 0) {
$('#shadow').fadeOut(500);
var animate = 1;
}
});
I hope to use some other expressions further down the line, so that depending on the value of "animate", another jquery action will be executed when clicked. I'm sure I missed something obvious, but I hit my head against the wall, trying to figure out what it is.
Any help would be appreciated!
source
share