K
kess
I am using the following code for a slideshow, the benefit being it
waits for the next image to load, I really want it to loop, any ideas?
The author has dead links.
<SCRIPT LANGUAGE="JavaScript">
<!--
/*
Script by FPMC at http://jsarchive.8m.com
Submitted to JavaScript Kit (http://javascriptkit.com)
For this and 400+ free scripts, visit http://javascriptkit.com
*/
//set image paths
src = ["image1.gif", "image2.gif", "image3.gif", "image4.gif"]
//set corresponding urls
url = ["http://freewarejava.com", "http://javascriptkit.com", "http://
dynamicdrive.com", "http://www.geocities.com"]
//set duration for each image
duration = 4;
//Please do not edit below
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*1000);
}
function doLink(){
location.href = url[ct];
} onload = function(){
if (document.images)
switchAd();
}
//-->
</SCRIPT>
<A HREF="javascript:doLink();" onMouseOver="status=url[ct];return
true;"
onMouseOut="status=''">
<IMG NAME="Ad_Image" SRC="image1.gif" BORDER=0>
</A>
<p align="center"><font face="arial" size="-2">This free script
provided by <a href="http://javascriptkit.com">JavaScript Kit</a></
font></p>
waits for the next image to load, I really want it to loop, any ideas?
The author has dead links.
<SCRIPT LANGUAGE="JavaScript">
<!--
/*
Script by FPMC at http://jsarchive.8m.com
Submitted to JavaScript Kit (http://javascriptkit.com)
For this and 400+ free scripts, visit http://javascriptkit.com
*/
//set image paths
src = ["image1.gif", "image2.gif", "image3.gif", "image4.gif"]
//set corresponding urls
url = ["http://freewarejava.com", "http://javascriptkit.com", "http://
dynamicdrive.com", "http://www.geocities.com"]
//set duration for each image
duration = 4;
//Please do not edit below
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*1000);
}
function doLink(){
location.href = url[ct];
} onload = function(){
if (document.images)
switchAd();
}
//-->
</SCRIPT>
<A HREF="javascript:doLink();" onMouseOver="status=url[ct];return
true;"
onMouseOut="status=''">
<IMG NAME="Ad_Image" SRC="image1.gif" BORDER=0>
</A>
<p align="center"><font face="arial" size="-2">This free script
provided by <a href="http://javascriptkit.com">JavaScript Kit</a></
font></p>