Jennifer said:
I'm inserting a rotating banner into my site. Am I able to link each
seperate picture to a seperate URL? It seems that I'm only able to link
all
of the pictures to one URL ??
Thanks!
Would this do the job ?
The only problem I noticed is that when the image changes, you have to move
the mouse to get the new URL to appear in the status bar
<html>
<head>
<script type="text/javascript">
// Set up the image files to be used.
var theImages = new Array() // do not change this
// Set up the URL names to be used.
var theURLs = new Array() // do not change this
// To add more image files and URLs, continue with the
// pattern below, adding to the arrays.
theImages[0] = 'images/1.jpg'
theImages[1] = 'images/2.jpg'
theImages[2] = 'images/3.jpg'
theImages[3] = 'images/4.jpg'
theURLs[0] = 'fred.com'
theURLs[1] = 'nerk.com'
theURLs[2] = 'joe.com'
theURLs[3] = 'blow.com'
// delay between rotating images (in seconds)
var interval = 2.5
interval *= 1000
// do not edit anything below this line
var p = theImages.length;
var preBuffer = new Array()
for (i = 0; i < p; i++){
preBuffer
= new Image()
preBuffer.src = theImages
}
function showImage(){
var whichImage = Math.round(Math.random()*(p-1))
document.getElementById("place").innerHTML = '<a href="' +
theURLs[whichImage]+ '"><img src="' +theImages[whichImage] +'"></a>'
setTimeout("showImage()", interval)
}
</script>
</head>
<body onload="showImage()">
<div id="place"></div>
</body>
</html>