Results 1 to 3 of 3

Thread: Problems with Preloaded Slide Show

  1. #1
    Join Date
    Sep 2008
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Problems with Preloaded Slide Show

    1) Script Title: Preloades Slide Show Script

    2) Script URL (on DD):

    http://www.dynamicdrive.com/dynamici...eloadslide.htm

    3) Describe problem:

    I have follow the steps but my script does not work, the photos donīt appear. What happen?

    This is the code I have:

    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
    <html>
    <head>
    <script language="JavaScript">

    //Preloaded slideshow script- By Jason Moon
    //For this script and more
    //Visit http://www.dynamicdrive.com

    // PUT THE URL'S OF YOUR IMAGES INTO THIS ARRAY...
    var Slides = ('defr(4).jpg','defr(5).jpg','defr.jpg');

    // DO NOT EDIT BELOW THIS LINE!
    function CacheImage(ImageSource) { // TURNS THE STRING INTO AN IMAGE OBJECT
    var ImageObject = new Image();
    ImageObject.src = ImageSource;
    return ImageObject;
    }

    function ShowSlide(Direction) {
    if (SlideReady) {
    NextSlide = CurrentSlide + Direction;
    // THIS WILL DISABLE THE BUTTONS (IE-ONLY)
    document.SlideShow.Previous.disabled = (NextSlide == 0);
    document.SlideShow.Next.disabled = (NextSlide ==
    (Slides.length-1));
    if ((NextSlide >= 0) && (NextSlide < Slides.length)) {
    document.images['Screen'].src = Slides[NextSlide].src;
    CurrentSlide = NextSlide++;
    Message = 'Picture ' + (CurrentSlide+1) + ' of ' +
    Slides.length;
    self.defaultStatus = Message;
    if (Direction == 1) CacheNextSlide();
    }
    return true;
    }
    }

    function Download() {
    if (Slides[NextSlide].complete) {
    SlideReady = true;
    self.defaultStatus = Message;
    }
    else setTimeout("Download()", 100); // CHECKS DOWNLOAD STATUS EVERY 100 MS
    return true;
    }

    function CacheNextSlide() {
    if ((NextSlide < Slides.length) && (typeof Slides[NextSlide] ==
    'string'))
    { // ONLY CACHES THE IMAGES ONCE
    SlideReady = false;
    self.defaultStatus = 'Downloading next picture...';
    Slides[NextSlide] = CacheImage(Slides[NextSlide]);
    Download();
    }
    return true;
    }

    function StartSlideShow() {
    CurrentSlide = -1;
    Slides[0] = CacheImage(Slides[0]);
    SlideReady = true;
    ShowSlide(1);
    }
    </script>
    <title>Fotos divertidas</title>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
    </head>
    <body background="/body2.gif">
    <p><font color="#FFFFFF" size="+4"><strong>Fotos divertidas</strong></font></p>
    <p>&nbsp;</p>
    <form name="SlideShow">
    <table>
    <tr>
    <td colspan=2><div align="center"></div></td>
    </tr>
    <tr>
    <td><input type="button" name="Previous"
    value=" << "
    onClick="ShowSlide(-1)"></td>
    <td align="right"><input type="button" name="Next"
    value=" >> " onClick="ShowSlide(1)"></td>
    </table>
    <div align="center"><img name="Screen" width=500 height=576> </div>
    </form>
    <p>&nbsp;</p>
    <p>&nbsp;</p>
    <p>&nbsp;</p>
    <p>&nbsp;</p>
    <p align="center">&nbsp;</p>
    <p>&nbsp;</p>
    </body onLoad="StartSlideShow()">
    </html>


    I would very gratefull if someone help me. I am not an expert in this stuff!

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

    This (from your post):

    Code:
    var Slides = ('defr(4).jpg','defr(5).jpg','defr.jpg');
    doesn't follow the example (from the demo page):

    Code:
    var Slides = new Array('image1.gif','image2.gif','image3.gif');
    There could be other problems. If you need more help:

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

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

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

    Default

    Thanks Jhon, the problem is solved.

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
  •