This library rotates an image.
In the above example, it does rotate, but i want to animate it.
i use setInterval() , but it doesn’t work:
window.onload = function(){
var elem = document.getElementById("im");
setInterval(function (){Rotate(elem, Math.PI/6)}, 1000/30);
}
Is there a chance to animate it? What is the right way to use this library?
Fiddle: http://jsfiddle.net/PjDnu/10/
The
<img>element doesn’t exist after executingRotate. I’ve adjusted the code, so that the image keeps rotating. To accomplish this, I have made the following modifications:Rotate: This should be the container element, with an unique ID.