JSFiddle - React, Tailwind, and code Playground
HTML
<div class="fillColor1"></div>
<div class="fillColor2"></div><br/>
<button>Click me</button>
CSS
.fillColor1 {
background: black;
height: 0;
margin-left: 24px;
position: relative;
width: 3px;
}
.fillColor2 {
background: black;
height: 0;
margin-left: 41px;
position: relative;
width: 3px;
}
JavaScript
function fx(elem, callback) {
alert('called ' + elem[0]);
$('.fillColor' + elem[0])
.animate({
height: '50px'
}, 600, function() {
elem.splice(0, 1);
callback.call($, elem)
});
};
/*
function second() {
alert('called second');
$('.fillColor2').animate({
height: '50px'
}, 600);
}
*/
$('button').click(function() {
fx.call($, [1, 2], fx);
});