There are various ways to do this, I chose this one -
Change your array to look like this (edit the captions as desired):
Code:
//define images. You can have as many as you want:
photos[0]=["/hayes/slideshow/ss01.jpg", "caption here1"]
photos[1]=["/hayes/slideshow/ss02.jpg", "caption here2"]
photos[2]=["/hayes/slideshow/ss03.jpg", "caption here3"]
photos[3]=["/hayes/slideshow/ss04.jpg", "caption here4"]
photos[4]=["/hayes/slideshow/ss05.jpg", "caption here5"]
photos[5]=["/hayes/slideshow/ss06.jpg", "caption here6"]
photos[6]=["/hayes/slideshow/ss07.jpg", "caption here7"]
photos[7]=["/hayes/slideshow/ss08.jpg", "caption here8"]
photos[8]=["/hayes/slideshow/ss09.jpg", "caption here9"]
A word of caution, do not use double quotes (") within the captions without escaping them, ex:
Code:
photos[0]=["/hayes/slideshow/ss01.jpg", "Baby "Sparky""]
is bad but:
Code:
photos[0]=["/hayes/slideshow/ss01.jpg", "Baby \"Sparky\""]
is fine.
Now we need to modify other parts of the script. Replace the backward and forward functions with these (changes red):
Code:
function backward(){
if (which>0){
which--
applyeffect()
document.images.photoslider.src=photos[which][0]
document.all? document.all['cap'].innerHTML=photos[which][1] : document.getElementById('cap').innerHTML=photos[which][1]
playeffect()
keeptrack()
}
}
function forward(){
if (which<photos.length-1){
which++
applyeffect()
document.images.photoslider.src=photos[which][0]
document.all? document.all['cap'].innerHTML=photos[which][1] : document.getElementById('cap').innerHTML=photos[which][1]
playeffect()
keeptrack()
}
}
Add to the script in the body section like so (red again):
Code:
<script type="text/javascript">
if (linkornot==1)
document.write('<a href="javascript:transport()">')
document.write('<img src="'+photos[0][0]+'" name="photoslider" style="filter:revealTrans(duration=2,transition=23)" border=0><div id="cap">'+photos[0][1]+'</div>')
if (linkornot==1)
document.write('</a>')
</script>
Bookmarks