0

I have this javascript that is working great in Firefox but will not load in IE. Can anyone help me please?

<body OnLoad="rotateImage('rImage', 'link')">

<center>
<a id="rLink" style="color:white"><img id="rImage" width=198 height=150>
</a></center>

</body>


<SCRIPT LANGUAGE="JavaScript">

var interval = 5; // delay between rotating images (in seconds)
var random_display = 0; // 0 = no, 1 = yes
interval *= 1000;

var image_index = 0;
image_list = new Array();
image_list[image_index++] = new imageItem("/resource/resmgr/Ad_Banner/ad1.jpg", "http://google.com");
image_list[image_index++] = new imageItem("/resource/resmgr/Ad_Banner/ad2.jpg", "http://yahoo.com");
image_list[image_index++] = new imageItem("/resource/resmgr/Ad_Banner/ad3.jpg", "http://msn.com");
image_list[image_index++] = new imageItem("/resource/resmgr/Ad_Banner/ad4.jpg", "http://sccah.com");
image_list[image_index++] = new imageItem("/resource/resmgr/Ad_Banner/ad5.jpg", "https://online.sccah.org");
image_list[image_index++] = new imageItem("/resource/resmgr/Ad_Banner/ad6.jpg", "http://msn.com");
image_list[image_index++] = new imageItem("/resource/resmgr/Ad_Banner/ad7.jpg", "http://msn.com");
image_list[image_index++] = new imageItem("/resource/resmgr/Ad_Banner/ad8.jpg", "http://www.sccah.com/?page=SCFestival");

var number_of_image = image_list.length;

function imageItem(image_location, link) {
this.image_item = new Image();
this.image_item.src = image_location;
this.image_item.link = link;
}


function getNextImage() {
if (random_display) {
image_index = Math.floor(Math.random() * image_list.length);
}
else {
image_index = (image_index+1) % number_of_image;
}

var new_image = image_list[image_index];
return(new_image);
}


function rotateImage(rImage, link) {
var new_image = getNextImage();
document.getElementById('rImage').src = new_image.image_item.src;
document.getElementById('rLink').href = new_image.image_item.link;

setTimeout("rotateImage()", interval);
}

</script>

2
Contributors
1
Reply
2
Views
7 Years
Discussion Span
Last Post by NormR1
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.