I am learning javascript on a site that has a design board so it writes the html for me and I write the js (have no access to anything other than that). I am trying to rotate an image to var degrees onEvent mousemove (I already have var degrees from another part of the game). Is there some sort of turnTo as there is for the turtle? If not is there anything that will rotate the image x degrees?
Asked
Active
Viewed 67 times
-1
-
It is explained [here](https://stackoverflow.com/questions/51167628/how-to-rotate-image-in-javascript) – Gopi Feb 16 '19 at 00:01
1 Answers
0
How can I rotate an image using only javascript?
In JavaScript you can use Element.animate()
where supported. Or alternatively use requestAnimationFrame
and set the style
attribute of the element to the relevant CSS values in succession for the duration of the expected effect.

guest271314
- 1
- 15
- 104
- 177