|
Script Introduction
A script that allows you to display what appears to be a single image animation using 5 different images.
The images in the animation will need to be all the same size. The animation repeats indefinitely.
Cut and Paste Code: HEAD Section
This code should be placed between the <head> and </head> tags.
Cut and Paste Code: BODY Section
This code should be placed between the <body> and </body> tags.
Installation Instructions
-
Paste the HEAD Section code from above between the <head> and </head> tags on your page.
-
Paste the BODY Section code from above between the <body> and </body> tags on your page,
exactly where you want the animation to appear.
-
Change the text in red below to the appropriate image addresses. Change the options at the
top of the script to adjust the appearance of your images.
pic_width=100; /*change to match the height of all your images */
pic_height=100; /* change to match the width of all your images */
/* define the length of time to stay on each image */
/* 1000 = 1 second */
var delay=2000;
/* define image urls */
if (document.images)
{
pic1= new Image(pic_width,pic_height);
pic1.src="http://someplace.com/image1.gif";
pic2= new Image(pic_width,pic_height);
pic2.src="http://someplace.com/image2.gif";
pic3= new Image(pic_width,pic_height);
pic3.src="http://someplace.com/image3.gif";
pic4= new Image(pic_width,pic_height);
pic4.src="http://someplace.com/image4.gif";
pic5= new Image(pic_width,pic_height);
pic5.src="http://someplace.com/image5.gif";
}
-
Check the Format Window
to be sure you do not have one single line of code, or too many line breaks in the code.
Example
A working sample of the script is shown below.
|