JSFiddle - React, Tailwind, and code Playground
HTML
<div class="slider"></div>
CSS
.slider {
width: 100px;
height: 100px;
position: absolute;
right: 200px; /* Standard value, like -200px in your case */
background: grey;
}
JavaScript
$(document).ready(function() {
var right = $('.slider').css("right");
setTimeout(function() {
$('.slider').animate({right: 0}, 800);
}, 750);
$(document).click(function(e) {
$('.slider').stop(true).animate({right: right}, 800);
//stop: second parameter false not needed, as it's default ;)
});
});