I am using the following script from javascriptkit.com for a slideshow. I need to know if there is a way for me to point to an entire directory of photos instead of listing the photos seperately. I am often replacing photos or adding new ones and instead of having to update my script each time, it would be great if I could tell the script to run the slide show based on all of the images in the "Photos" directory instead of listing each photo individually. I would apprecaite any feedback.
<script language="JavaScript1.1">
<!--
var slideimages=new Array()
var slidelinks=new Array()
function slideshowimages(){
for (i=0;i<slideshowimages.arguments.length;i++){
slideimages=new Image()
slideimages.src=slideshowimages.arguments
}
}
function slideshowlinks(){
for (i=0;i<slideshowlinks.arguments.length;i++)
slidelinks=slideshowlinks.arguments
}
function gotoshow(){
if (!window.winslide||winslide.closed)
winslide=window.open(slidelinks[whichlink])
else
winslide.location=slidelinks[whichlink]
winslide.focus()
}
//-->
</script>
</head>
<body bgcolor="#000000"><center><a href="javascript:gotoshow()"><img src="DCP_0301.jpg" name="slide" border=0></a>
<script>
<!--
//configure the paths of the images, plus corresponding target links
slideshowimages("DCP_0301.jpg","awas_2.jpg","DCP_0292.jpg","DCP_0293.jpg","DCP_0294.jpg","DCP_0295.jpg","DCP_0296.jpg","DCP_0297.jpg",
"DCP_0298.jpg","DCP_0299.jpg","DCP_0300.jpg","awas_1.jpg","talking_7.jpg","DCP_0303.jpg","DCP_0304.jpg","DCP_0305.jpg",
"DCP_0306.jpg","ed_1.jpg","ed_2.jpg","ed_.jpg","talking_1.jpg",
"talking_2.jpg","talking_3.jpg","talking_4.jpg","talking_5.jpg","talking_6.jpg","DCP_0302.jpg","Town_01.jpg","Town_02.jpg",
"Town_05.jpg","Town_06.jpg","Town_07.jpg","Town_08.jpg","Town_09.jpg","Town_10.jpg","Town_12.jpg","Town_14.jpg","Town_15.jpg","Town_16.jpg"
//configure the speed of the slideshow, in miliseconds
var slideshowspeed=5000
var whichlink=0
var whichimage=0
function slideit(){
if (!document.images)
return
document.images.slide.src=slideimages[whichimage].src
whichlink=whichimage
if (whichimage<slideimages.length-1)
whichimage++
else
whichimage=0
setTimeout("slideit()",slideshowspeed)
}
slideit()
//-->
</script>
<script language="JavaScript1.1">
<!--
var slideimages=new Array()
var slidelinks=new Array()
function slideshowimages(){
for (i=0;i<slideshowimages.arguments.length;i++){
slideimages=new Image()
slideimages.src=slideshowimages.arguments
}
}
function slideshowlinks(){
for (i=0;i<slideshowlinks.arguments.length;i++)
slidelinks=slideshowlinks.arguments
}
function gotoshow(){
if (!window.winslide||winslide.closed)
winslide=window.open(slidelinks[whichlink])
else
winslide.location=slidelinks[whichlink]
winslide.focus()
}
//-->
</script>
</head>
<body bgcolor="#000000"><center><a href="javascript:gotoshow()"><img src="DCP_0301.jpg" name="slide" border=0></a>
<script>
<!--
//configure the paths of the images, plus corresponding target links
slideshowimages("DCP_0301.jpg","awas_2.jpg","DCP_0292.jpg","DCP_0293.jpg","DCP_0294.jpg","DCP_0295.jpg","DCP_0296.jpg","DCP_0297.jpg",
"DCP_0298.jpg","DCP_0299.jpg","DCP_0300.jpg","awas_1.jpg","talking_7.jpg","DCP_0303.jpg","DCP_0304.jpg","DCP_0305.jpg",
"DCP_0306.jpg","ed_1.jpg","ed_2.jpg","ed_.jpg","talking_1.jpg",
"talking_2.jpg","talking_3.jpg","talking_4.jpg","talking_5.jpg","talking_6.jpg","DCP_0302.jpg","Town_01.jpg","Town_02.jpg",
"Town_05.jpg","Town_06.jpg","Town_07.jpg","Town_08.jpg","Town_09.jpg","Town_10.jpg","Town_12.jpg","Town_14.jpg","Town_15.jpg","Town_16.jpg"
//configure the speed of the slideshow, in miliseconds
var slideshowspeed=5000
var whichlink=0
var whichimage=0
function slideit(){
if (!document.images)
return
document.images.slide.src=slideimages[whichimage].src
whichlink=whichimage
if (whichimage<slideimages.length-1)
whichimage++
else
whichimage=0
setTimeout("slideit()",slideshowspeed)
}
slideit()
//-->
</script>