JSFiddle - React, Tailwind, and code Playground
HTML
<div class="image-photo-previous"></div>
CSS
.image-photo-previous {
background-color: #222222;
height: 100px;
width: 200px;
}
JavaScript
$(document).ready(function() {
$(".image-photo-previous").on('mouseenter mouseleave', function( e ) {
$(this).stop().animate({marginLeft: e.type=="mouseenter"?-50:0}, 300);
});
});