asked on
ASKER
ASKER
ASKER
$("button.myclass").click(function(evt) {
if($("button.myclass.active").length>0) return false; // cancel because the user is working
doSomething1();
doSomething2();
doSomething3();
$.post("url.php", params, function() { // some ajax call here or somewhere else
$("button.myclass.active").remove("active"); // the user have finish to work, unlock, autorise new processing
});
});
ASKER
i noticed that you're passing the event into the function, is there a reason ?
ASKER
ASKER
ASKER
If my understanding is correct, I don't see that fulfilling the objective. I can make the help button inactive, but I need all buttons / dom elements [click events mainly] to be disabled while that process [original click on the help button] is still live.
Another option would be to overlay your page with a transparent div that blocks any interaction
ASKER
JavaScript is a dynamic, object-based language commonly used for client-side scripting in web browsers. Recently, server side JavaScript frameworks have also emerged. JavaScript runs on nearly every operating system and in almost every mainstream web browser.
TRUSTED BY
in each button click event you check the variable OR if a button have the class (active)
if the variable is set OR button.class is found you break the execution: return false