i want to disable click function untill every code in it; initialized and completed.
i read these articles and tried what they said but cant make it happen: event.pr
You can try this:
var exec_a1 = true, exec_a2 = true;
$('.ele').click(function() {
if (exec_a1 && exec_a2) {
exec_a1 = false;
exec_a2 = false;
$('.ele').stop().animate({'top': '0px'}, 2000, function() {
exec_a1 = true;
});
$(this).stop().animate({'top': '100px'}, 4000, function() {
exec_a2 = true;
});
}
return false;
});