JSFiddle - React, Tailwind, and code Playground
HTML
<p>Test...</p>
<hr />
<ul>
<div id="2">Click 1</div>
<div id="3">Click 2</div>
<div id="b">Click 3</div>
<div id="d">Click 4</div>
</ul>
<br /><br /><br /><br />
<ul>
<span>Im thumb 1</span>
<span>Im thumb 2</span>
<span>Im thumb 3</span>
<span>Im thumb 4</span>
</ul>
CSS
span {background: red;position: absolute; left: 0;}
JavaScript
$(function() {
$('div').each(function(i,n) {
$(n).click(function() {
$('p').append($(this).text());
$('ul span').eq(i).animate({
left: '50%'
}, 1000);
});
})
});