+ 2
Why it does't work correctly??
6 Respuestas
+ 2
here is working code
var x;
var r = 328;
function right(){
x = document.getElementById("p")
r=r-5
x.style.right = r + "px";
if(r<=0) {
clearInterval(b)
}
}
var b;
function rightd(){
b = setInterval(right,100)
}
+ 1
becuase 'width' of the element is 300 something and you compare it to the 'right' of the smiley which get smaller every time. think about it, the condition cannot be true in that case because roght will not catch up to width
+ 1
in the 7th line instead of div width put 0 + px and see magic happend
0
Can you edit it plz??
0
see my code nothing happend
0
Oh thanks