I am using the following code for an image slideshow:
<body BGCOLOR="#000000" text="#CCCCCC" link="#CC9933" vlink="#999966" alink="#FFCC33" onload="doLink">
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tr>
<td>
<SCRIPT LANGUAGE="JavaScript">
<!--
//set image paths
src = ["images/Pic1.jpg", "images/Pic2.bmp", "images/Pic3.jpg"]
//set duration for each image
duration = 2;
ads=[]; ct=0;
function switchAd()
{
var n=(ct+1)%src.length;
if (ads[n] && (ads[n].complete || ads
[n].complete==null))
{
document["Ad_Image"].src = ads[ct=n].src;
}
ads[n=(ct+1)%src.length] = new Image;
ads[n].src = src[n];
setTimeout("switchAd()",duration*600);
}
function doLink(){
} onload = function(){
if (document.images)
switchAd();
}
//-->
</SCRIPT>
<IMG NAME="Ad_Image" SRC=http://www.webdeveloper.com/forum/archive/index.php/"images/Pic1.jpg" BORDER=0 width="150" length="120">
Although the images do change at some point, they don't begin changing when the page just loads.
Is there something that I need to change in the code to have the images flip as soon as the page loads?
Here's the website:
<!-- w --><a class="postlink" href="http://www.MonarchMedical.com">www.MonarchMedical.com</a><!-- w -->
Thanks,
Ninel
<body BGCOLOR="#000000" text="#CCCCCC" link="#CC9933" vlink="#999966" alink="#FFCC33" onload="doLink">
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tr>
<td>
<SCRIPT LANGUAGE="JavaScript">
<!--
//set image paths
src = ["images/Pic1.jpg", "images/Pic2.bmp", "images/Pic3.jpg"]
//set duration for each image
duration = 2;
ads=[]; ct=0;
function switchAd()
{
var n=(ct+1)%src.length;
if (ads[n] && (ads[n].complete || ads
[n].complete==null))
{
document["Ad_Image"].src = ads[ct=n].src;
}
ads[n=(ct+1)%src.length] = new Image;
ads[n].src = src[n];
setTimeout("switchAd()",duration*600);
}
function doLink(){
} onload = function(){
if (document.images)
switchAd();
}
//-->
</SCRIPT>
<IMG NAME="Ad_Image" SRC=http://www.webdeveloper.com/forum/archive/index.php/"images/Pic1.jpg" BORDER=0 width="150" length="120">
Although the images do change at some point, they don't begin changing when the page just loads.
Is there something that I need to change in the code to have the images flip as soon as the page loads?
Here's the website:
<!-- w --><a class="postlink" href="http://www.MonarchMedical.com">www.MonarchMedical.com</a><!-- w -->
Thanks,
Ninel