JSFiddle - React, Tailwind, and code Playground
HTML
<div id="panel">
<div id="panel-content"></div>
<div id="panel-tab">
<div id="myTab">
<p>Click</p>
</div>
</div>
</div>
CSS
#panel
{
position: absolute;
height: 100%;
background: transparent;
right: 0;
}
#panel-content
{
position: relative;
width: 175px;
height: 100%;
background: black;
float:right;
}
#panel-tab
{
position: relative;
width: 50px;
height: 100%;
background-color: transparent;
float:left;
}
#myTab
{
position: relative;
top: 150px;
background: black;
height: 200px;
width: 90%;
color: White;
}
#myTab p
{
margin: 0;
}
JavaScript
$(function () {
var $pCont = $("#panel-content");
$pCont.width(0);
$("#panel").hover(function(ev){
$pCont.stop().animate({width: ev.type=="mouseenter" ? 500 : 0}, 700);
});
});