+ 2
How to draw graphics in css and move accordingly in any direction as we want?
I have to make a box and move in it as I want. Means any pixels right,left,top,bottom by just using arrow keys
1 Réponse
+ 11
1> set an key event listener to get the arrows keys when pressed
2> set css property of your box to be 'position:absolute;' mode and dynamically set 'left' and 'top' property let you move it in viewport coordinates...