In jQuery è semplice sovrascrivere un evento.
La soluzione consiste nel rimuovere prima l'handler associato e quindi aggiungere un nuovo handler.
$( "#btn" ).off( "click" ).on( "click", function() {
//...
});
In jQuery è semplice sovrascrivere un evento.
La soluzione consiste nel rimuovere prima l'handler associato e quindi aggiungere un nuovo handler.
$( "#btn" ).off( "click" ).on( "click", function() {
//...
});