J'ai la configuration de script ci-dessous. Je voudrais mieux réécrire le script auquel les fonctions sont assignées plus spécifiques à chaque clic, EG. Click = 3 does so and so, and Click = 4, does this and that.
Fonctions affectées au nombre de clics/clics
EDIT: Par exemple, vous pouvez consulter mon échantillon en direct à l'avis « http://bit.ly/10BW89N », les clics fait feu commande. J'ai ajouté une simple 'alerte' pour essayer et tester, et les clics et les fonctions ne se déclenchent toujours pas dans le bon ordre.
$(document).ready(function() {
var a1_Events = [function1, function2, function3, function5, function6, function7, function8],
a1_c = 0;
function function1() {
alert('SHAKING!');
}
function function2() {
alert('BZZZZZZZZZZZ!');
}
function function3() {
$("#area1").hide();
$("#area2").show();
}
function function5() {
alert('YES!');
}
function function6() {
$("#bg_div").hide(0).delay(1500).show(0);
$("#bg_skew").show(0).delay(1500).hide(0);
}
function function7() {
alert('NO!');
}
function function8() {
$("#area1").hide(0).delay(1500).show(0);
$("#area2").hide(0).delay(1500).show(0);
$("#sound1").show(0).delay(1500).hide(0);
}
$('#area1').click(function() {
a1_Events[a1_c++ % a1_Events.length]();
});
$("#area2").click(function() {
$("#area1").show();
$("#area2").hide();
});
});
..autres suggestions?