JSFiddle - React, Tailwind, and code Playground

by Ahmad Baktash Hayeri

HTML

<div class="left"></div>
<div class="right"></div>

CSS

.left {
   width:100px;
    background:red;
   height: 200px;
    float:left;
    -webkit-transition: all .4s;
    -moz-transition: all .4s;
}

.right{
   background:blue;
   width: auto;
    height:200px;
}

JavaScript

var size = ['100px', '400px'];
var i = 0;
$('.left').click(function(){
    i = (i + 1 > 1)? 0: ++i;
    $(this).css('width', size[i]);
});