Announcement

Collapse
No announcement yet.

how do i continue the array for the slideshow

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • 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 [URL="http://www.CodeLifter.com"]www.CodeLifter.com[/URL]
    // [URL="http://www.codelifter.com"]http://www.codelifter.com[/URL]
    // 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
    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.
    My NASCAR Forum

    Comment


    • #3
      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.

      Comment


      • #4
        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.

        Comment


        • #5
          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.
          My NASCAR Forum

          Comment


          • #6
            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 [URL="http://www.CodeLifter.com"]www.CodeLifter.com[/URL]
            // [URL="http://www.codelifter.com"]http://www.codelifter.com[/URL]
            // 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="[URL="http://pic1.jpg"]pic1.jpg[/URL]" name='SlideShow' width=200 height=200></td>
            </tr>
            </table>
             
            </HEAD>
            <BODY bgcolor="#FFFFFF" text="#000000">
            <body onload="runSlideShow()">  
            </BODY>
            </HTML>

            Comment


            • #7
              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.
              My NASCAR Forum

              Comment


              • #8
                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

                Comment


                • #9
                  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.

                  Comment


                  • #10
                    Re: how do i continue the array for the slideshow

                    lol Now you understand my haircut.
                    My NASCAR Forum

                    Comment


                    • #11
                      Re: how do i continue the array for the slideshow

                      Lol

                      Comment

                      Working...
                      X