Random Image w/ Link
To begin, download Photo.zip and open up photo.js in notepad. it should look like this:
Now replace all the image.jpgs with actual URLS to images. Say that all your images are in a folder called images, you'll need to put:
images/image.jpg
Even if the script is in the same folder as the image, you'll have to define the absolute path to the image no matter what unless it is in root. If it is in root, please use the whole URL to the image: http://www.yourdomain.com/image.jpg
Now, edit the links below. Each number corresponds to each other. Like the image links correspond with the same number of the URL link.
Say myimages[4] was "purple.gif" and i want it to go to yahoo.com:
and below:
|
imagelinks[4]="http://www.yahoo.com"
|
MAKE SURE THEY ARE THE SAME NUMBER. image 1 goes to link 1, image 2 goes to link 2 and so on.
Add more:
Once again, to add another link/image just copy the code, change the number, change the image, and change the link:
and
|
imagelinks[5]="link.htm">
|
Displaying the code:
To display the code, use this tag wherever you'd like to see it appear:
|
<script src="photo.js"></script>
|
|