PDA

View Full Version : slideshow images wont show!!


gutterglitter96
02-11-2003, 09:56 AM
i'm new to javascript so i got a cut and paste slide show to try. i can get it to work on my computer just fine but when i uploaded everything it doesnt work right. the layout for the slideshow is there but there is only an X in the box where the images should be. i uploaded the folders and files w/ the same names as i used on my computer so i dont think thats the problem. any ideas?

here's the URL to what i have now http://www2.onu.edu/~stu7437/slideshow/trial.htm

heres the original script i used before i changed anything:

<HEAD>

<SCRIPT LANGUAGE="JavaScript">
<!-- Original: Mike Canonigo (mike@canonigo.com) -->
<!-- Web Site: http://www.munkeehead.com -->

<!-- This script and many more are available free online at -->
<!-- The JavaScript Source!! http://javascript.internet.com -->

<!-- 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 chgImg(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("chgImg(1)", delay);
}
}
// End -->
</script>

</HEAD>

<!-- STEP TWO: Copy this code into the BODY of your HTML document -->

<BODY>

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

<p><center>
<font face="arial, helvetica" size"-2">Free JavaScripts provided<br>
by <a href="http://javascriptsource.com">The JavaScript Source</a></font>
</center><p>

beetle
02-11-2003, 01:37 PM
Did you upload the images to the correct directory? Looks like it should be

http://www2.onu.edu/~stu7437/slideshow/images/

requestcode
02-11-2003, 01:40 PM
You might try specifying it like this:
http://www2.onu.edu/~stu7437/slideshow/images/1.gif

That should work if your images directory is under the slideshow directory.

Oops looks like beetle and I responded at the same time.

gutterglitter96
02-11-2003, 04:13 PM
hehe, i feel stupid. i was lookin around and then realized that the program i use to edit my photos automatically saves them with a capital .JPG at the end after editing even if the rest of the name is lowercase, and since javascript is case sensitive that was messin with it cuz i was ending with .jpg.

thanks for the help though!

requestcode
02-11-2003, 06:11 PM
Don't feel stupid. It has happened to me and I am sure most others here at one time or another. I don't know how many times I have spent hours looking at and changing code only to find it was a simple syntax error. Good Luck! :D