JSFiddle - React, Tailwind, and code Playground

by sarathsprakash

HTML

<div id='content'>
    <input type='button' id='clk1' value='Close' />
</div>
<input type='button' id='clk' value='open' />

CSS

#content {
    position:absolute;
    width:200px;
    height:300px;
    background:red;
}
#clk {
    position:absolute;
    left:300px;
}
#clk1
{
    position:absolute;
    left:70px;
    top:160px;
}
}

JavaScript

$(document).ready(function () {
    $('#content').css('left', -$('#content').innerWidth());
    $('#clk').click(function () {
        $('#content').animate({'left':0});
    });
    $('#clk1').click(function () {
        $('#content').animate({'left':-$('#content').innerWidth()});
    });
});