2
I am on time having problems with jQuery events. I have used all the best practices to stop the double event of click. Following are examples:
.off()
e.preventDefault();
e.stopPropagation();
unbid('click');
Always when there is a click I perform this function
function LoadingTela(botao,tipo) {
if (tipo == true) {
$(botao).prop("disabled", true);
$('.mask-loading').show();
}else {
$(botao).prop("disabled", false);
$('.mask-loading').hide();
}
}
Has anyone come up with any solution or new event control?
It seems that your event is being called twice, the .off you said you used, was it time to create the event? For example, try to do $("#button"). off("click"). on("click",Function(){ /your stuff here/ }); to prevent it from being created twice or more. If this does not work you can try something more complex, something like saving your button when it is clicked and only allow clicks again after, say, 1 second. If I need I can set you an example.
– Henrique Pauli
function LoadingTela(botao,tipo) {
 if (tipo == true) {
 $(botao).prop("disabled", true);
 $('.mask-loading').show();
 } else {
 $(botao).prop("disabled", false);
 $('.mask-loading').hide();
 } 
}
– Guilhermezio