JSFiddle - React, Tailwind, and code Playground
HTML
<div id="rightmenu"></div>
CSS
#rightmenu{
border:1px solid black;
height:100px;
width:100px;
position:absolute;
left:30%;
}
JavaScript
var checker = new Boolean();
checker = true;
$("#rightmenu").click(function () {
var left = checker ? "10%" : "30%";
$(this).animate({left: left},400);
checker = !checker;
});