Forum Moderators: open

Message Too Old, No Replies

Slideshow

         

dr_bay

6:20 pm on Sep 11, 2005 (gmt 0)

10+ Year Member



I'm trying to make a slideshow using javascript and diplay the image number under the picture, i.e. image 1 of 11. I can display all the images but I do not know how to get the page numbers to change for each picture. I have 11 pics but took them out to save space. I know I need to add something to each statement in the checkIt function to update the page number and then add a document.write to display it. But I'm unsure of the syntax. The two lines with? next to it are the lines I'm not sure of. Any help would be appreciated.

<script language="Javascript">
var current = 0;
function imageArray() {
this.length = imageArray.arguments.length;
for (var i = 0; i < this.length; i++)
{
this[i] = imageArray.arguments[i];
}
}
var pic = new imageArray
(
"CIMG0026.JPG",
"CIMG0027.JPG",
);

document.write('<img name="img" src="'+pic[0]+'" width="800" height="600">');
document.write("<br><br>Image ")
?document.write("" +page.text.value+ " of 11");

function checkIt(val)
{
var goodnum = current+val;
if (goodnum < 0)
{
goodnum = 10;
document.img.src = pic[goodnum];

}
else if (goodnum > pic.length-1)
{
goodnum = 0;
document.img.src = pic[goodnum];

}
else
{
document.img.src = pic[goodnum];
text=goodnum;

?full=document.page[goodnum].value;
}
current = goodnum;
}

</script>

dr_bay

1:55 am on Sep 13, 2005 (gmt 0)

10+ Year Member



anybody?