With the help of the jQuery library and the offset() method it seems logical to think that by writing this simple code the element will gradually change position
for (i = 0; i < 900; i = i + .5) {
$('#moving-element').offset({ top: i })
}
The browser will stop for a while and will finally move the element to a position 900px apart from the top, no transition can be observed. Out of curiosity i wrote this :
for (i = 0; i < 900; i = i + .5) {
$('#moving-element').offset({ top: i });
console.log(i)
}
to see that the console is outputting the succession of numbers fine, but it only offsets the element once the for loop is over.
Why is this not done gradually as the code is being executed?