Results 1 to 11 of 11

Thread: how do i continue the array for the slideshow
      
   

  1. #1
    CyberShot's Avatar
    CyberShot is offline First Sergeant
    Join Date
    Jan 2007
    Posts
    84

    Default how do i continue the array for the slideshow

    i have this code and it says to add more images to just continue the array below, but when i try to do that, the slideshow stops working. do you know how to fix it. also, how can i specify the location of the images. right now they run from the root directory, i want to put them in a folder called slideshow.
    Code:
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
    <HTML>
    <HEAD>
    <META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
    <TITLE>Untitled Page</TITLE>
    <META name="GENERATOR" content="Created by BlueVoda">
    <script>
    // (C) 2000 www.CodeLifter.com
    // http://www.codelifter.com
    // Free for all users, but leave in this  header
    // NS4-6,IE4-6
    // Fade effect only in IE; degrades gracefully
    // =======================================
    // set the following variables
    // =======================================
    // Set slideShowSpeed (milliseconds)
    var slideShowSpeed = 5000
    // Duration of crossfade (seconds)
    var crossFadeDuration = 3
    // Specify the image files
    var Pic = new Array() // don't touch this
    // to add more images, just continue
    // the pattern, adding to the array below
    Pic[0] = 'pic9.jpg'
    Pic[1] = 'pic10.jpg'
    Pic[2] = 'pic11.jpg'
    Pic[3] = 'pic12.jpg'
    Pic[4] = 'pic13.jpg'
    // =======================================
    // do not edit anything below this line
    // =======================================
    var t
    var j = 0
    var p = Pic.length
    var preLoad = new Array()
    for (i = 0; i < p; i++){
       preLoad[i] = new Image()
       preLoad[i].src = Pic[i]
    }
    function runSlideShow(){
       if (document.all){
          document.images.SlideShow.style.filter="blendTrans(duration=2)"
          document.images.SlideShow.style.filter="blendTrans(duration=crossFadeDuration)"
          document.images.SlideShow.filters.blendTrans.Apply()      
       }
       document.images.SlideShow.src = preLoad[j].src
       if (document.all){
          document.images.SlideShow.filters.blendTrans.Play()
       }
       j = j + 1
       if (j > (p-1)) j=0
       t = setTimeout('runSlideShow()', slideShowSpeed)
    }
    </script>
     
    <table border="1" cellpadding="0" cellspacing="0">
    <tr>
    <td id="VU" height=150 width=150>
    <img src="pic1.jpg" name='SlideShow' width=200 height=200></td>
    </tr>
    </table>
     
    </HEAD>
    <BODY bgcolor="#FFFFFF" text="#000000">
    <body onload="runSlideShow()">  
    </BODY>
    </HTML>

  2. #2
    racefan20's Avatar
    racefan20 is offline Major General
    Join Date
    Jul 2005
    Location
    Concord, NC
    Posts
    2,339

    Default Re: how do i continue the array for the slideshow

    To pull the pics from a directory, you'd simply need to change the path

    Pic[0] = 'slideshow/pic9.jpg'
    Pic[1] = 'slideshow/pic10.jpg'
    Pic[2] = 'slideshow/pic11.jpg'
    Pic[3] = 'slideshow/pic12.jpg'
    Pic[4] = 'slideshow/pic13.jpg'
    As far as why it quits working, I'd guess you're making a small mistake somewhere, but it's tough to tell where that might be based on what you've posted.

  3. #3
    CyberShot's Avatar
    CyberShot is offline First Sergeant
    Join Date
    Jan 2007
    Posts
    84

    Default Re: how do i continue the array for the slideshow

    it simply says to coninue the pattern. so that's what i did

    pic[5] = 'pic10.jpg'
    pic[6] = 'pic11.jpg'
    and so on
    and so on

    so the pattern started by the program ends at pic[4]

    so i added pic[5] and just kept going. no mistake there.

  4. #4
    CyberShot's Avatar
    CyberShot is offline First Sergeant
    Join Date
    Jan 2007
    Posts
    84

    Default Re: how do i continue the array for the slideshow

    ok, now i feel retarded. i can't believe i didn't think to add the slideshow at the beginning of the

    Pic[0] = 'slideshow/pic9.jpg'
    Pic[1] = 'slideshow/pic10.jpg'
    Pic[2] = 'slideshow/pic11.jpg'
    Pic[3] = 'slideshow/pic12.jpg'
    Pic[4] = 'slideshow/pic13.jpg'

    that part is working now. lol..thanks. now if i can get it to take more than just five, i will be there.

  5. #5
    racefan20's Avatar
    racefan20 is offline Major General
    Join Date
    Jul 2005
    Location
    Concord, NC
    Posts
    2,339

    Default Re: how do i continue the array for the slideshow

    Please try again and if it fails again, please post the exact code you're using.

    If you could put it on a web page so we can see it, it might help as well.

  6. #6
    CyberShot's Avatar
    CyberShot is offline First Sergeant
    Join Date
    Jan 2007
    Posts
    84

    Default Re: how do i continue the array for the slideshow

    the page is active, just not linked it's

    www.creativeeventsdesign.com/slideshow.html the page is under construction and is just a test right now. i have the five images working, and they are now in the slideshow folder thanks to you. and the exact code that i am using right now is here.

    Code:
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
    <HTML>
    <HEAD>
    <META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
    <TITLE>Untitled Page</TITLE>
    <META name="GENERATOR" content="Created by BlueVoda">
    <script>
    // (C) 2000 www.CodeLifter.com
    // http://www.codelifter.com
    // Free for all users, but leave in this  header
    // NS4-6,IE4-6
    // Fade effect only in IE; degrades gracefully
    // =======================================
    // set the following variables
    // =======================================
    // Set slideShowSpeed (milliseconds)
    var slideShowSpeed = 5000
    // Duration of crossfade (seconds)
    var crossFadeDuration = 3
    // Specify the image files
    var Pic = new Array() // don't touch this
    // to add more images, just continue
    // the pattern, adding to the array below
    Pic[0] = 'slideshow/pic9.jpg'
    Pic[1] = 'slideshow/pic10.jpg'
    Pic[2] = 'slideshow/pic11.jpg'
    Pic[3] = 'slideshow/pic12.jpg'
    Pic[4] = 'slideshow/pic13.jpg'
    // =======================================
    // do not edit anything below this line
    // =======================================
    var t
    var j = 0
    var p = Pic.length
    var preLoad = new Array()
    for (i = 0; i < p; i++){
       preLoad[i] = new Image()
       preLoad[i].src = Pic[i]
    }
    function runSlideShow(){
       if (document.all){
          document.images.SlideShow.style.filter="blendTrans(duration=2)"
          document.images.SlideShow.style.filter="blendTrans(duration=crossFadeDuration)"
          document.images.SlideShow.filters.blendTrans.Apply()      
       }
       document.images.SlideShow.src = preLoad[j].src
       if (document.all){
          document.images.SlideShow.filters.blendTrans.Play()
       }
       j = j + 1
       if (j > (p-1)) j=0
       t = setTimeout('runSlideShow()', slideShowSpeed)
    }
    </script>
     
    <table border="1" cellpadding="0" cellspacing="0">
    <tr>
    <td id="VU" height=150 width=150>
    <img src="pic1.jpg" name='SlideShow' width=200 height=200></td>
    </tr>
    </table>
     
    </HEAD>
    <BODY bgcolor="#FFFFFF" text="#000000">
    <body onload="runSlideShow()">  
    </BODY>
    </HTML>

  7. #7
    racefan20's Avatar
    racefan20 is offline Major General
    Join Date
    Jul 2005
    Location
    Concord, NC
    Posts
    2,339

    Default Re: how do i continue the array for the slideshow

    The script works fine. I just created a slide show and added 5 pics and they all display properly. click here

    You probably accidentally left out one small little detail and that's enough to break the whole thing.

  8. #8
    CyberShot's Avatar
    CyberShot is offline First Sergeant
    Join Date
    Jan 2007
    Posts
    84

    Default Re: how do i continue the array for the slideshow

    ok, i will try again and post the code for you to look at and maybe you can tell what is wrong because i can't. give me a 3 min

  9. #9
    CyberShot's Avatar
    CyberShot is offline First Sergeant
    Join Date
    Jan 2007
    Posts
    84

    Default Re: how do i continue the array for the slideshow

    i figured it out. what i did wrong was i used a lower case p on the pic[5]. it needed to be an uppercase P. it's working now. thanks for the help. i am going to pick my hair up off the floor now and glue it back to my head.

  10. #10
    racefan20's Avatar
    racefan20 is offline Major General
    Join Date
    Jul 2005
    Location
    Concord, NC
    Posts
    2,339

    Default Re: how do i continue the array for the slideshow

    lol Now you understand my haircut.

  11. #11
    CyberShot's Avatar
    CyberShot is offline First Sergeant
    Join Date
    Jan 2007
    Posts
    84

    Default Re: how do i continue the array for the slideshow

    Lol

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

     

Posting Permissions

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

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49