PDA

View Full Version : Slideshow Script - Slidetimes



Adnan959
09-28-2010, 11:34 AM
Hey Guys,

I need a bit of help please, so i'll try to keep it short.

This is the script I'm using and its working fine:
http://www.dynamicdrive.com/dynamicindex14/fadeinslideshow.htm

BUT, my requirement is a little different. I want to program it so that I can give each slide a specfic time before it rotates. So for example image01.jpg after 3 seconds, image02.jpg after 6 seconds and image03.jpg after 10 seconds.

Does anyone know how to achieve this?

I'm thinking this the setting that has to be modified a bit, but then again I'm not sure:

var mygallery=new fadeSlideShow({
wrapperid: "fadeshow1", //ID of blank DIV on page to house Slideshow
dimensions: [940, 314], //width/height of gallery in pixels. Should reflect dimensions of largest image
imagearray: [
["images/slides/image01.jpg", ""],
["images/slides/image02.jpg", "", "", ""],
["images/slides/image03.jpg", "", "", ""],
["images/slides/image04.jpg", "", "", ""],
["images/slides/image05.jpg", "", "", ""],
["images/slides/image06.jpg", "", "", ""],
["images/slides/image07.jpg", "", "", ""],
["images/slides/image08.jpg", "", "", ""],
["images/slides/image09.jpg", "", "", ""],
["images/slides/image10.jpg", "", "", ""] //<--no trailing comma after very last image element!
],
displaymode: {type:'auto', pause:7000, cycles:0, wraparound:false},
persist: false, //remember last viewed slide and recall within same session?
fadeduration: 500, //transition duration (milliseconds)
descreveal: "ondemand",
togglerid: ""
})


Any responses are highly appreciated. :)

Thanks a lot

jscheuer1
09-28-2010, 12:57 PM
Add the highlighted:


var mygallery=new fadeSlideShow({
wrapperid: "fadeshow1", //ID of blank DIV on page to house Slideshow
dimensions: [940, 314], //width/height of gallery in pixels. Should reflect dimensions of largest image
imagearray: [
["images/slides/image01.jpg", ""],
["images/slides/image02.jpg", "", "", ""],
["images/slides/image03.jpg", "", "", ""],
["images/slides/image04.jpg", "", "", ""],
["images/slides/image05.jpg", "", "", ""],
["images/slides/image06.jpg", "", "", ""],
["images/slides/image07.jpg", "", "", ""],
["images/slides/image08.jpg", "", "", ""],
["images/slides/image09.jpg", "", "", ""],
["images/slides/image10.jpg", "", "", ""] //<--no trailing comma after very last image element!
],
displaymode: {type:'auto', pause:3000, cycles:0, wraparound:false},
persist: false, //remember last viewed slide and recall within same session?
fadeduration: 500, //transition duration (milliseconds)
descreveal: "ondemand",
togglerid: "",
onslide: function(c, i){
this.setting.displaymode.pause =
i === 0? 3000 :
i === 1? 6000 :
i === 2? 10000 :
3000;
}
})

Don't miss the added comma (red) after the togglerid value.

Notice the 0?, 1?, 2? - those are the slide indexes. the first slide is 0, the second is 1 and so on. The times to the right of each number? are the pause for that slide, how long it will be visable, in milliseconds. You can add more numbers. The 3000 at the end is the default.

If you specify a time for each slide index, you must still have a default. It will never be used, but is required to avoid a logical error.

Adnan959
09-30-2010, 05:30 PM
John,

This is amazing. Thank you so much. You're truly a star. Works like a charm.

Thanks once again!