JSFiddle - React, Tailwind, and code Playground
by andredgusmao
HTML
<div class="content">
</div>
CSS
.content {
background-color: red;
height: 200px;
margin: 2em 8em;
width: 200px;
}
JavaScript
var content = $('.content');
jQuery.fn.cool = function(speed, easing, callback) {
var $this = $(this),
H = $this.height();
return $this.animate({'height': H/2+'px'}, 400, function(){
$this.delay(100).animate({'width': 0+'px'}, 300, function(){
});
});
}
content.on('click', function(){
$(this).cool();
});