Sunday, 18 August 2013

Very Basic Jquery - Why wont this if / else with a variable work?

Very Basic Jquery - Why wont this if / else with a variable work?

The code in the if should only execute one time, but somehow, it works all
the time
$(document).ready(function() {
var count = 0;
if(count = 0){
$('#enter').click(function() {
count = 1;
$(this).fadeTo("fast","0.8");
});
} else {};
});

No comments:

Post a Comment