...

View Full Version : Rotating an image onClick



IronCode
07-05-2003, 05:26 AM
I'm sure this can be done, I was wandering if somebody might now where i could pickup such a small script. It would have to swap it back on second click also.

What it's used for is and arrow that will point down when a table is opened and then point to the right after it is closed. I totally suck at JavaScript and am trying to learn it on the fly with projects rather then sitting an dedicate a complete session to it.

Any help would be great thanks guys.

boywonder
07-06-2003, 02:21 AM
Hi - you are looking for some basic image swapping. You can find a few tutorials regarding this at http://www.javascriptkit.com/javaindex.shtml
good luck

IronCode
07-06-2003, 04:46 AM
Thanks for the link. I'm gonna read a few of them as i need to get some of this crap down. Kinda funny i can do pretty much anything i want with PHP but can't write a single JavaScript script without looking for some kind of help.

Thanks again.

Kor
07-07-2003, 09:13 AM
Anyway, the ideea is that, as far as I know, the images can not be rotated using DOM, "stricto senso" (latin expression:-)), as Flash appears to do. You need a number of different images which, as in movie, are visible/hidden one after another quickly, and creates the movement ilusion.

In your case, you need maybe no more that two arrows, which are alternatively visible/hidden, according to the Event you have. That means you have to make a script which will manage the CSS style visible/hidden of the two objects, your 2 arrows



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum