Answer the question
In order to leave comments, you need to log in
Element rotation animation in pure js?
For a long time I racked my brain as much as possible without frameworks, using pure js to organize the animation of the rotation of elements, for example, clockwise. While "digging" in google, I only found something similar to jquery) Of course, you can not bathe, and such interesting and maybe complex things are undoubtedly better done on frameworks, but you also really need to know. Can you tell me how to organize this in pure js?
Answer the question
In order to leave comments, you need to log in
What do you mean by "pure js"? You can only influence the display style of an element using styles (css), and how you set them (via js / originally written) is not so important.
Jquery is not a framework, but a library, these are different concepts.
You can change the style of an element using pure js. You can change the rotation angle of the element through the interval / requestAnimationFrame (as copal cited above ).
Askelem.style.transform = "rotate(" + deg + "deg)";
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question