JSFiddle - React, Tailwind, and code Playground
by huppen
HTML
<div id="Msg">
Countdown für <span>5</span> Sekunden.
</div>
JavaScript
//Countdown Script
var sec = 4
var timer = setInterval(function() {
$('#Msg span').animate({
opacity: 0.25,
fontSize: '1em'
}, 50, function() {
$('#Msg span').css('opacity', 1);
$('#Msg span').text(sec--);
})
if (sec === 0) {
clearInterval(timer);
}
}, 950);
setTimeout(function(){
$('#Msg').append("<p>ACTION</p>");
}, 5000);