I have this simple to-do-list with JQuery. When I delete or add an item, there will be a message shown with fadein, fadeout and delay JQuery method.
The whole app works well except that when I have many items which I want to delete many items very quickly, the message will still continue to show one by one.
I try e.stopPropagation() to stop the previous event but it seems like not working.
function clearMesg() {
$(".mesg").stop().fadeIn(500).delay(500).fadeOut(500);
}
$(".del").on("click", function (e) {
e.stopPropagation();
$(this).parent().remove();
$('.mesg').text("Deleted.");
clearMesg();
});