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? confused

Offline

 

#2 2008-01-16 10:33 pm

Miles
Now I fight for wisdom!
Administrator
From: Michigan
Registered: 2001-07-21
Posts: 4482
Website

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

Daniel
[dp] design#
From: Indian Harbour Beach, FL
Registered: 2000-11-21
Posts: 9234
Website

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.


Airman Dan
Private Pilot, Airplane Single-Engine Land
http://homepage.mac.com/dp.design/.Pictures/maf/crosssig.gif
ONE NATION WITH LIBERTY AND JUSTICE FOR ALL.

Offline

 

Board footer

Powered by PunBB
© Copyright 2002–2005 Rickard Andersson