Results 1 to 5 of 5

Thread: Using more than ten images in Swiss Army Slideshow

  1. #1
    Join Date
    Sep 2007
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Using more than ten images in Swiss Army Slideshow

    1) Script Title: Swiss Army Slideshow

    2) Script URL (on DD):
    http://www.dynamicdrive.com/dynamici...army/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.

    Code:
    <!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>

  2. #2
    Join Date
    Jun 2005
    Location
    英国
    Posts
    11,876
    Thanks
    1
    Thanked 180 Times in 172 Posts
    Blog Entries
    2

    Default

    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).
    Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends français | entiendo español | tôi ít hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!

  3. #3
    Join Date
    Sep 2007
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    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....

    Quote Originally Posted by Twey View Post
    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).

  4. #4
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    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:

    Code:
    <!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:

    Code:
    <!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.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  5. #5
    Join Date
    Sep 2007
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    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...

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •