The code below should move the element "box" down by "speed" pixels every second, and "speed" should decrease by 0.1 every second. This should give the illusion of slowing movement. If anyone knows how to fix this code - or offer a different solution - it would be greatly appreciated.
function move() {
var pos = 318;
for (var speed = 5; speed > 0; speed -= 0.1) {
setTimeout(function() {
pos -= speed;
document.getElementById("box").style.bottom = pos + "px";
}, 1000);
}
}