JSFiddle - React, Tailwind, and code Playground
HTML
<div id="a" style="background:red;width:100px;height:100px"></div>
<div id="b" style="background:green;width:100px;height:100px"></div>
<div id="c" style="background:blue;width:100px;height:100px"></div>
<div id="d" style="background:yellow;width:100px;height:100px"></div>
<button type="button" id="btn">START</button>
<button type="button" id="btn2">RESET</button>
JavaScript
$('#btn').click(function() {
$('#a').fadeTo('fast', 0, function() {
// The below will not work
$('#a').fadeTo('fast', 1);
});
$('#b').fadeTo('fast', 0, function() {
});
$('#c').fadeTo('fast', 0);
$('#d').fadeTo('fast', 0);
});
$('#btn2').click(function() {
$('#a').queue([]).css({
opacity: 1
});
$('#b').queue([]).css({
opacity: 1
});
$('#c').queue([]).css({
opacity: 1
});
$('#d').queue([]).css({
opacity: 1
});
});