PDA

View Full Version : Using more than ten images in Swiss Army Slideshow



guarana
09-21-2007, 11:37 AM
1) Script Title: Swiss Army Slideshow

2) Script URL (on DD):
http://www.dynamicdrive.com/dynamicindex14/swissarmy/index.htm

3) Describe problem: I have more than 10 images in my slideshow. The show works fine, but gets stuck after number 8 (9 in the array). Below is the code I use. I cannot find what I did wrong in my definition. I assume the slideshow can cope with more images, or is there a problem with the array used to store the image locations? Unfortunately, my knowledge of javascript is too limited to be able to find this out myself.

Thanks in advance to anyone that can point me in the right direction.



<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN"
"http://www.w3.org/TR/html4/frameset.dtd">
<HTML>
<HEAD>
<TITLE>Selection of projects</TITLE>
<link href="style.css" rel="stylesheet">

<script type="text/javascript">

//If using image buttons as controls, Set image buttons' image preload here true
//(use false for no preloading and for when using no image buttons as controls):
var preload_ctrl_images=false;

//And configure the image buttons' images here:
var previmg='left.gif';
var stopimg='stop.gif';
var playimg='play.gif';
var nextimg='right.gif';

var slides=[]; //FIRST SLIDESHOW
//configure the below images and descriptions to your own.
slides[00] = ["../img/slideshowprojects/alcas.jpg", "Alcas"];
slides[01] = ["../img/slideshowprojects/dart.png", "DART"];
slides[02] = ["../img/slideshowprojects/semirtm.jpg", "Semi-RTM Box"];
slides[03] = ["../img/slideshowprojects/cargodoor.jpg", "Composite cargo door"];
slides[04] = ["../img/slideshowprojects/arbre.png", "Composite driveshaft with integrated composite flange"];
slides[05] = ["../img/slideshowprojects/deur.png", "Door"];
slides[06] = ["../img/slideshowprojects/finbox.png", "Finbox"];
slides[07] = ["../img/slideshowprojects/slinger.jpg", "TUD"];
slides[08] = ["../img/slideshowprojects/tango.png", "TANGO"];
slides[09] = ["../img/slideshowprojects/thick.png", "90 mm"];
slides[10] = ["../img/slideshowprojects/wingskin.png", "ALCAS Wing Skin"];
slides.manual_start=1; //start show in manual mode (stopped)
slides.counter=1; //use to show image count

</script>

<script src="../scripts/swissarmy.js" type="text/javascript">

/***********************************************
* Swiss Army Image slide show script - John Davenport Scheuer: http://home.comcast.net/~jscheuer1/
* This notice MUST stay intact for legal use
* Visit Dynamic Drive at http://www.dynamicdrive.com/ for full original source code
***********************************************/

</script>


</HEAD>

<BODY>
<div class="title">Selected projects</div>

<p>Press &quot;Play&quot; for an automatic show of browse at your own pace using the forward and back buttons. </p>


<script type="text/javascript">
new inter_slide(slides)
</script>

</BODY>
</HTML>

Twey
09-21-2007, 12:10 PM
A prefix of 0 in Javascript denotes an octal (base eight) number. 8 and 9 aren't valid octal digits, so the script errors out when it sees 08. To make it work, just remove the extraneous zeroes (you can pad it out with spaces if you want to).

guarana
09-21-2007, 12:25 PM
Thanks for answering.

I had actually added the zeroes myself to see wheter it would make a difference. Without them, I get stuck the same way, just tried it again, without the zeros. No luck....:(


A prefix of 0 in Javascript denotes an octal (base eight) number. 8 and 9 aren't valid octal digits, so the script errors out when it sees 08. To make it work, just remove the extraneous zeroes (you can pad it out with spaces if you want to).

jscheuer1
09-21-2007, 03:39 PM
Well, Twey is correct in what he says about the numbers, I'm not certain about padding numbers with spaces inside of the square brackets, but it should be OK. Your code looks like it would work if written out with the proper numbering.

You cannot use this DOCTYPE though:


<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN"
"http://www.w3.org/TR/html4/frameset.dtd">

for a regular page with no frameset. Try:


<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/1999/REC-html401-19991224/loose.dtd">

I've used the script with 100's of images, so there is virtually no limit on the number that may be used.

If it is still not working, you probably have some other error somewhere.

Please post a link to the page on your site that contains the problematic script so we can check it out.

guarana
09-24-2007, 10:17 AM
Thank you for the help.

I just figured out it out, I made a mistake myself. :(

One image was missing, I had not added it to the batch. The show stopped at that image. It coincided with the tenth image, that is why I suspected an error. I just added the image and everything is working fine.

Sorry about the mess up...