-1

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?

1
  • It is explained here Commented Feb 16, 2019 at 0:01

1 Answer 1

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.

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.