JSFiddle - React, Tailwind, and code Playground
by danbeam
HTML
<div class="dead">Hey!</div>
CSS
div {
background; red;
position: fixed;
-webkit-transition: top 5s linear;
}
div.dead {
top: 500px;
}
div.jesus {
top: 0;
}
JavaScript
var div = document.querySelector('.dead');
setInterval(function() {
console.log(window.getComputedStyle(div, null)['top']);
}, 200);
setTimeout(function() {
div.className += ' jesus';
}, 1000);