JSFiddle - React, Tailwind, and code Playground
HTML
<div id="sliderArrow" style="position:absolute; left:-20">text</div>
<a href="#" onclick="togglethis()">slide text</a>
<script type="text/javascript">
function togglethis() {
$("a").removeAttr("onclick");
$("#sliderArrow").animate({ marginLeft: '235' }, 500);
$("a").toggle(
function() {
$("#sliderArrow").animate({ marginLeft: '0' }, 500);
}, function() {
$("#sliderArrow").animate({ marginLeft: '235' }, 500);
}
);
}
</script>