JSFiddle - React, Tailwind, and code Playground
HTML
<div class="stackoverflow">
Hi there!
</div>
CSS
.stackoverflow {
background-color: aqua;
width: 300px;
height: 20px;
}
JavaScript
$('.stackoverflow').click(function() {
do_hide.call(this);
});
var do_hide = function()
{
is_anim = true;
$(this).animate({
opacity: 0.25,
height: 'toggle',
width: 'toggle'
}, 5000,
function() {
is_anim = false;
this.hide();
});
}