This is my previous code. It only hides the parent targeted container:
$(".black-icon").click(function() {
var taskid = $(this).parent().attr('id');
$("#" + taskid).parentsUntil(".container").hide("slide", {
direction: "right"
}, 500);
});
Here is the setTimeout
that I added so that it gets removed and not only hidden:
$(".black-icon").click(function() {
var taskid = $(this).parent().attr('id');
$("#" + taskid).parentsUntil(".container").hide("slide", {
direction: "right"
}, 500);
setTimeout(() => {
$("#" + taskid).parentsUntil(".container").remove();
}, 1000);
});
Update: Is there a way I could use the same slide function (jQuery UI) with remove?