View Single Post
Old 07-28-2004, 10:25 AM   #3 (permalink)
imaginemn
v7n Mentor
 
imaginemn's Avatar
 
Join Date: 02-18-04
Location: Minneapolis, Minnesota
Posts: 1,935
iTrader: 0 / 0%
imaginemn is a name known to allimaginemn is a name known to allimaginemn is a name known to allimaginemn is a name known to allimaginemn is a name known to allimaginemn is a name known to allimaginemn is a name known to allimaginemn is a name known to allimaginemn is a name known to allimaginemn is a name known to allimaginemn is a name known to all
Send a message via MSN to imaginemn Send a message via Yahoo to imaginemn Send a message via Skype™ to imaginemn
The images should not matter. Here is a typical array.

[code:1:4fb09d101d]pic[0] = '1.gif';
pic[1] = '2.gif';
pic[2] = '3.gif';[/code:1:4fb09d101d]

OR

[code:1:4fb09d101d]pic = new Array("1.gif","2.gif","3.gif")[/code:1:4fb09d101d]

It really depends on the code and how you are calling the array. There are so many ways to do this.

Post the rest of the javascript code and I can see what is wrong with it or you can try the following. (Replace the images with your own.)

[code:1:4fb09d101d]<HEAD>
<SCRIPT LANGUAGE="JavaScript">
<!-- Begin
NewImg = new Array ("images/1.gif","images/2.gif","images/3.gif");
var ImgNum = 0;
var ImgLength = NewImg.length - 1;

//Time delay between Slides in milliseconds
var delay = 3000;
var lock = false;
var run;
function nextImg(direction) {
if (document.images) {
ImgNum = ImgNum + direction;
if (ImgNum > ImgLength) {
ImgNum = 0;
}
if (ImgNum < 0) {
ImgNum = ImgLength;
}
document.slideshow.src = NewImg[ImgNum];
}
}

function auto() {
if (lock == true) {
lock = false;
window.clearInterval(run);
} else if (lock == false) {
lock = true;
run = setInterval("nextImg(1)", delay);
}
}
// End -->
</script>
</HEAD>
<BODY>

<img src="images/1.gif" name="slideshow">
<table>
<tr>
<td align="right"><a href="javascript:nextImg(-1)">Previous</a></td>
<td align="center"><a href="javascript:auto()">Auto/Stop</a></td>
<td align="left"><a href="javascript:nextImg(1)">Next</a></td>
</tr>
</table>[/code:1:4fb09d101d]

imaginemn
__________________
Imagine Creative Services
Design : Marketing : Multimedia : More
imaginemn is offline   Reply With Quote