JSFiddle - React, Tailwind, and code Playground
by Sam Tyson
HTML
<div id="div1"></div>
<div id="div2"></div>
CSS
div {
position: absolute;
border: 1pt black solid;
height: 100px;
width: 100px;
}
#div1 {
top: 0;
left: 0;
background-color: blue;
}
#div2 {
bottom: 0;
right: 0;
background-color: red;
}
JavaScript
$("body")
.queue("fader", function(next) {
$("#div1").animate({ "left": 300, "top": 200 }, 1000, next);
})
.queue("fader", function(next) {
$("#div2").animate({ "right": 300, "bottom": 400 }, 1000, next);
})
.dequeue("fader");