JSFiddle - React, Tailwind, and code Playground
HTML
<div class="wrap">
<div class="panel left"></div>
<div class="panel right"></div>
</div>
CSS
.wrap {
position: relative;
width: 200px;
height: 200px;
margin: 100px auto;
}
.panel {
position: absolute;
z-index: 1;
top: 0;
width: 100px;
height: 200px;
transition: 0.3s linear;
}
.left {
background: url(http://placekitten.com/200/200) left top no-repeat;
left: 0;
}
.left.slide {
left: -100px;
width: 200px;
}
.right {
right: 0;
background: url(http://placekitten.com/230/200) right top no-repeat;
}
.right.slide {
right: -100px;
width: 200px;
}
JavaScript
jQuery('.left,.right').mouseenter(function(){
jQuery(this).addClass('slide');
});