Reputation: 887
If i have a button pressed method like this:
$('#next').click(function () {
});
How can i stop this method being initiated whilst its running. Say the method takes 5 seconds to run and someone clicks it 3 seconds in it breaks so i want to make the div thats being clicked unclickable while the methods running.
Upvotes: 0
Views: 218
Reputation: 38529
You can use "disabled" to disable the button while your execution, as like byron said
Upvotes: 0
Reputation: 3084
$('#next').click(function () {
$(this).attr("disabled", "disabled");
stuffff
$(this).attr("disabled", "");
});
Upvotes: 7