T
T
thehighhomie2015-10-28 22:51:11
JavaScript
thehighhomie, 2015-10-28 22:51:11

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

1 answer(s)
L
littleguga, 2015-10-28
@thehighhomie

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 question

Ask a Question

731 491 924 answers to any question