|
Script by: Robert Gasiorowski Now that's great! And the image is active. This one is a bit involved. Here are the instructions the authors sent along:
Here is my new script that animates image.
It uses CSS so it can be used only with version 4 of the browser.
I tested it on NN4 but not IE4 but it should work.
Here are instructions:
Image moves around 64 pixel grid ( but you can change it ).
I did it that way, because I wanted this script to be short one.
You simply specify new coordinates x ( from the left edge ) and y ( from
the top of the page ). xylist[even] is x and xylist[odd] is y.
xylist[0] and xylist[1] are the starting coordinates.
those coords. mean start at 0,0 then go to 128,128 then go to 64,256
then back to 0,0 and repeat. Oh, I forgot to tell that it loops ( after
all coords. are used it goes back to start point and repeats ).
xylist[0]=0;
xylist[1]=0;
xylist[2]=128;
xylist[3]=128;
xylist[4]=64;
xylist[5]=256;
Important !! You must use multiplication of 64 ( 0,64,128,192,256,320
ect.) and
you must change the "var listlenght=10;" number to the total number of
xylist's.
Example above would have "var listlenght=6;".
You can change 64 step to lets say 32 and then you can move image more
precisely, but you have to change three numbers.
those two 64's:
xstep = ( endxpos - currxpos )/64;
ystep = ( endypos - currypos )/64;
and this 65 ( must be one bigger than the number you use, for 32 it will
be 33 ):
function increase() {
if ( i<65) {
To change the speed change the number in timeout ( here it is 10
milliseconds ):
setTimeout("increase()",10);
Grab the Script
Please note: This script is being offered in simple text format. When you click to Grab the Script, the text should display. Internet Explorer and AOL users may get a blank page or the script may run and produce the effect. If this happens, choose SAVE AS from the FILE menu and save the blank or compiled page.
|