The following coding is for a slide show. It works great except it doesn't have a continous loop. Instead it quits showing the pictures when it gets to the end of the list. Any ideas of how to get it to go back to the first picture when it gets to the end?
***************************
<HTML>
<HEAD>
<TITLE>Document Title</TITLE>
<SCRIPT language="javascript">
<!--
contents=new Array()
contents[contents.length]="pic01.jpg"
contents[contents.length]="pic02.jpg"
var preloadpics=new Array() // preloads images
for (i=0;i<=contents.length-1;i++) {
preloadpics[i]=new Image()
preloadpics[i].src=contents[i]
}
newTrans=new Array()
newTrans[newTrans.length] = "progid
XImageTransform.Microsoft.fade()";
var tranSpeed = 1.0; // how long transition takes in seconds
var pause = 2000 // in milliseconds
var advance = (tranSpeed*1000)+pause //
var i=0
var picnum=1
var loc=picnum-1
function RunMe(){
document.getElementById("div_A").style.filter = newTrans[i];
document.getElementById("div_A").filters[0].apply();
div_A.innerHTML = "<img src='"+contents[picnum]+"'width='"+document.getElementById("div_A").style.width+"'height='"+document.getElementById("div_A" ).style.height+"'>"
document.getElementById("div_A").filters[0].play(tranSpeed);
loc=picnum
timer=setTimeout("RunMe()",advance)
if(i==newTrans.length-1){
i=-1}
if(picnum==contents.length-1){
picnum=-1
clearTimeout(timer)
}
i++
picnum++
}
setTimeout("RunMe()",(tranSpeed*1000)+pause)
// -->
</SCRIPT>
</HEAD>
<BODY>
<DIV id="div_A" style="position:absolute; left:200px; top:100px; width:100px; height:100px; font-size:35px; text-align:center; filter(); cursor:hand"><img src="pic01.jpg" width=100px height=100px></DIV>
</BODY>
</HTML>
***************************
<HTML>
<HEAD>
<TITLE>Document Title</TITLE>
<SCRIPT language="javascript">
<!--
contents=new Array()
contents[contents.length]="pic01.jpg"
contents[contents.length]="pic02.jpg"
var preloadpics=new Array() // preloads images
for (i=0;i<=contents.length-1;i++) {
preloadpics[i]=new Image()
preloadpics[i].src=contents[i]
}
newTrans=new Array()
newTrans[newTrans.length] = "progid

var tranSpeed = 1.0; // how long transition takes in seconds
var pause = 2000 // in milliseconds
var advance = (tranSpeed*1000)+pause //
var i=0
var picnum=1
var loc=picnum-1
function RunMe(){
document.getElementById("div_A").style.filter = newTrans[i];
document.getElementById("div_A").filters[0].apply();
div_A.innerHTML = "<img src='"+contents[picnum]+"'width='"+document.getElementById("div_A").style.width+"'height='"+document.getElementById("div_A" ).style.height+"'>"
document.getElementById("div_A").filters[0].play(tranSpeed);
loc=picnum
timer=setTimeout("RunMe()",advance)
if(i==newTrans.length-1){
i=-1}
if(picnum==contents.length-1){
picnum=-1
clearTimeout(timer)
}
i++
picnum++
}
setTimeout("RunMe()",(tranSpeed*1000)+pause)
// -->
</SCRIPT>
</HEAD>
<BODY>
<DIV id="div_A" style="position:absolute; left:200px; top:100px; width:100px; height:100px; font-size:35px; text-align:center; filter(); cursor:hand"><img src="pic01.jpg" width=100px height=100px></DIV>
</BODY>
</HTML>
Comment