Forums | MacLife
You are not logged in.
#1 2008-01-16 7:51 pm
- McAddict
- Member

- Registered: 2006-09-08
- Posts: 616
Javascript Image Rotation
I want to make an image spin, but not use an animated GIF. Using Javascript, how can I rotate an image, for example, a hand of a clock.
Is it possible? 
Offline
#2 2008-01-16 10:33 pm
Re: Javascript Image Rotation
You'd have to use the canvas element (this is how the clock dashboard widget works). You may also be able to use SVG. There's no way in HTML 4/CSS.
Offline
#3 2008-01-16 11:40 pm
Re: Javascript Image Rotation
Alternatively, you could make a sprite with all the frames in one image, and use JavaScript to slide that image around inside a box with an explicitly set size.
Offline

