So I made a code
function slide()
{
var x=1;
while (x<=512)
{
document.getElementById("slide").style.backgroundPosition = x+"px 0px";
x++;
}
}
I want to make a transition from backgroundPosition - 0
to backgroundPosition 512
. This code above changes immediately from 0 to 512, I want to make it like 1<100ms break>, 2, 3...
I tried change x++
to setTimeout(function(){x++), 100)
but it doesn't do anything.