JSFiddle - React, Tailwind, and code Playground
by staeff
HTML
<!DOCTYPE html>
<html>
<head></head>
<body>
<div id="moveMe"></div>
</body>
</html>
CSS
#moveMe {
width: 50px;
height: 50px;
background-color: blue;
position: relative;
}
JavaScript
// .animate + .delay = move box;
$(document).ready(function () {
//your code here
$("#moveMe").click(function () {
$(this).animate({
left: "+=100px"
}).delay(1000)
.animate({
top: "+=100px"
});
});
});