JSFiddle - React, Tailwind, and code Playground

HTML

<div id="test"></div>

CSS

#test
{
  background: red;
  width: 150px;
  height:0px;
}

JavaScript

var i = 0;
var test = $('#test');

test.css({transition: 'height 2s linear', height: '100px'});

test.on('click', function() {
	test.css({transition: 'none', height: '0px'});
  setTimeout(function(){
    test.css({transition: 'height 2s linear', height: '100px'});
  },40);
});


test.on('transitionend webkitTransitionEnd', function(){
	test.text(++i);
});