Hi, I’m trying to help a friend with his site, but I’m useless at javascript and there’s an issue I just can’t get my head around.
I have an index.php file with an image that swaps out on a timer, looping with around 9 other images. The swap is handled by an external .js file, as below:
var SlideShowLeftSpeed = 12000
var crossFadeDuration = 15
var Pic = new Array()
Pic[0] = 'images/ad1.jpg'
Pic[1] = 'images/ad2.jpg'
Pic[2] = 'images/ad3.jpg'
Pic[3] = 'images/ad4.jpg'
Pic[4] = 'images/ad5.jpg'
Pic[5] = 'images/ad6.jpg'
Pic[6] = 'images/ad7.jpg'
Pic[7] = 'images/ad8.jpg'
Pic[8] = 'images/ad9.jpg'
Pic[9] = 'images/ad10.jpg'
var t
var j = 0
var p = Pic.length
var preLoad = new Array()
for (i = 0; i < p; i++){
preLoad* = new Image()
preLoad*.src = Pic*
}
function runSlideShowLeft(){
if (document.all){
document.images.SlideShowLeft.style.filter="blendTrans(duration=2)"
document.images.SlideShowLeft.style.filter="blendTrans(duration=crossFadeDuration)"
document.images.SlideShowLeft.filters.blendTrans.Apply()
}
document.images.SlideShowLeft.src = preLoad[j].src
if (document.all){
document.images.SlideShowLeft.filters.blendTrans.Play()
}
j = j + 1
if (j > (p-1)) j=0
t = setTimeout('runSlideShowLeft()', SlideShowLeftSpeed)
}
The problem is that I now have to find a way to make each image a link to a different website. I’ve made a named image map in the index.php file, but I can’t for the life of me figure out how to make the links change with the image.
Any help would be greatly appreciated.
Thanks,
Toby.