+ 1
Box rotation
I want to move a box to perform an infinity 360 deg rotation.The box must in a container. Any help will be highly appropriated . In JavaScript plz
2 Respuestas
+ 2
If you want an element to be in an endless rotation animation, use CSS.
Check the answer to this:
https://stackoverflow.com/questions/6410730/css-endless-rotation-animation
Here is some JavaScript that uses CSS to rotate the "js" tag on this page. If you're on a laptop or desktop, open your browser's JavaScript console and paste this to see the "js" tag rotate infinitely:
var e = document.querySelector('[data-value="js"]');
var style = document.createElement('style');
style.innerHTML = `@keyframes rotating {
from {
transform: rotate(0deg);
}
to {
transform: rotate(360deg);
}
}`;
document.querySelector('head').appendChild(style);
e.style.animation = 'rotating 2s linear infinite';
+ 1
Josh and Miriele,Thank you.