JSFiddle - React, Tailwind, and code Playground
HTML
<div id='box'>
CSS
#box {
width: 100px;
height: 100px;
background-color: green;
display: none;
}
JavaScript
$("#box")
.delay(4000) // Wait 2 seconds
.show("slow") // Then start a slow "show" animation
.delay(2000) // Wait 2 more seconds
.fadeOut("slow") // Then start a fadeout animation
.delay(1000) // Another wait
.promise()
.then(function(){alert("Done");}); // when all the animations are done, call my function.