Deshabilitar, Habilitar en ('clic')
¿Cómo puedo deshabilitar y habilitar un evento de clic?
Lo intenté con:
$('#web').on('click', function web_function(event){
event.stopPropagation();
// execute a bunch of action to preform
});
$('#web').off('click'); // click is succesfully removed
$('#web').on('click'); // doesnt work, i need to redefine the actions to perform
También he intentado deshabilitar con:
$('#web').unbind('click'); // click is succesfully removed
$('#web').bind('click'); // nok
Pero esto tampoco funciona ...
Por lo tanto, me gustaría deshabilitar / habilitar el evento de clic sin la necesidad de redefinir las acciones a realizar. Algún tipo de interruptor ... (haga clic en on / off)
¿Y cómo implemento el evento para detener la propagación?
¿Cómo puedo hacer esto?