JSFiddle - React, Tailwind, and code Playground

by Alain Martinez

HTML

<div id="wrap">
    <div class="box"></div> <a href="#" class="btn"></a>

</div>

CSS

.box {
    background:#cccccc;
    width:270px;
    height:300px;
    padding: 0px;
    float:left;
}
.btn {
    width: 30px;
    height: 300px;
    background:#000000;
    float: left;
    display: block;
}

JavaScript

$(document).ready(function () {

    $('.box').hide();

    $(".btn").click(function () {
        event.preventDefault();
        $(".box").animate({
            width: 'toggle'
        });
    });

});