Untitled
HTML
<div id="box">
</div>
CSS
body {
/* This only exists to remove
the ugly white background. */
background-color: rgba(0,0,0,0);
}
#box {
width: 5em;
height: 5em;
background-color: cyan;
position: absolute;
top: 1em;
left: 1em;
}
JavaScript
var box = document.getElementById("box");
//Reduce this value or set it to 0 (I
//want rid of the timeout altogether)
//and it will only function correctly
//intermittently.
var delay = 25;
setInterval(function(){
box.style.transition = "none";
box.style.left = "1em";
setTimeout(function(){
box.style.transition = "1s linear";
box.style.left = "11em";
}, delay);
}, 1000);