Sunday, 25 August 2013

Set Element Position in JavaScript

Set Element Position in JavaScript

I am trying to reset the Y position of a moving image in JS by repeatedly
using:
elem.style.top = "100px";
However, it works only for the first time, and afterwards the image just
flies off the screen.
Does anyone know why, and if there is a better way to do it?
Thanks.

No comments:

Post a Comment