dynamic slideshow

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • pradeepjain
    Contributor
    • Jul 2007
    • 563

    #1

    dynamic slideshow

    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 crossFadeDurati on = 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] = '1.jpg'
    Pic[1] = '2.jpg'
    Pic[2] = '3.jpg'
    Pic[3] = '4.jpg'
    Pic[4] = '5.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.styl e.filter="blend Trans(duration= 2)"
    document.images .SlideShow.styl e.filter="blend Trans(duration= crossFadeDurati on)"
    document.images .SlideShow.filt ers.blendTrans. Apply()
    }
    document.images .SlideShow.src = preLoad[j].src
    if (document.all){
    document.images .SlideShow.filt ers.blendTrans. Play()
    }
    j = j + 1
    if (j > (p-1)) j=0
    t = setTimeout('run SlideShow()', slideShowSpeed)
    }
    </script>




    i am using this javascript code for slideshow of images...i am in a small problem.....wht my client requires is tht when ever he puts a image in a particular folder tht image must be involved in the slideshow with out specifying the name of the image in code....is there any way so as to make javascript to pick all images in a folder by means of a php script and create a slideshow
    Last edited by pradeepjain; Dec 10 '07, 06:36 AM. Reason: error
  • ak1dnar
    Recognized Expert Top Contributor
    • Jan 2007
    • 1584

    #2
    Use readdir function to read the files from the specified directory and pass the parameters to javascripts.

    Comment

    Working...