最初にクリックしたときにdivを左に移動させ、2回目に元の位置に戻し、3回目に再び左に移動させたい..
では、なぜこれが機能しないのですか: http://jsfiddle.net/kS7KE/2/
var checker = new Boolean();
checker = true;
if (checker = true){
$("#div").click(function () {
$(this).animate({left: "10%"},400);
checker = false;
});
}
if (checker != true){
$("#div").click(function () {
$(this).animate({left: "30%"},400);
checker = true;
});
}