PDA

View Full Version : Stop at last slide after one cycle



mattmac
10-12-2012, 08:09 AM
1) Script Title: Continuous Reel Slideshow

2) Script URL (on DD): http://www.dynamicdrive.com/dynamicindex14/reelslideshow.htm

3) Describe problem:

How do you get the slideshow to do just one auto cycle of images and stop on the last one.

I have 8 slides, the last one being a statement rather than an image. I have set cycles to 1 but the slideshow goes back to slide number 1 and then stops. I want it to stop on slide 8.

jscheuer1
10-12-2012, 03:03 PM
Add the highlighted as shown to your on page init:


var mygallery=new fadeSlideShow({
wrapperid: "fadeshow1", //ID of blank DIV on page to house Slideshow
dimensions: [250, 180], //width/height of gallery in pixels. Should reflect dimensions of largest image
imagearray: [
["http://i26.tinypic.com/11l7ls0.jpg", "", "", "Nothing beats relaxing next to the pool when the weather is hot."],
["http://i29.tinypic.com/xp3hns.jpg", "http://en.wikipedia.org/wiki/Cave", "_new", "Some day I'd like to explore these caves!"],
["http://i30.tinypic.com/531q3n.jpg"],
["http://i31.tinypic.com/119w28m.jpg", "", "", "What a beautiful scene with everything changing colors."] //<--no trailing comma after very last image element!
],
displaymode: {type:'auto', pause:2500, cycles:1, wraparound:false},
persist: false, //remember last viewed slide and recall within same session?
fadeduration: 500, //transition duration (milliseconds)
descreveal: "ondemand",
togglerid: "",
oninit: function(){
--this.setting.totalsteps;
}
})

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

mattmac
10-12-2012, 03:20 PM
Hi John

I added the additional code but the slideshow no longer works. The code you posted refers to fadeSlideShow, does this make a difference?

Matt

jscheuer1
10-12-2012, 03:24 PM
Yes. my mistake, I misread your link to the script without clicking on it and thought that (fadeslideshow) was the slideshow you were talking about.

I'll have a look at the script you are using and let you know.

jscheuer1
10-12-2012, 03:38 PM
OK, say you have something like:


var firstreel=new reelslideshow({
wrapperid: "myreel", //ID of blank DIV on page to house Slideshow
dimensions: [300, 200], //width/height of gallery in pixels. Should reflect dimensions of largest image
imagearray: [
["../dynamicindex4/fruits.jpg"],
["../dynamicindex4/pool.jpg", "http://en.wikipedia.org/wiki/Cave", "_new"],
["../dynamicindex4/autumn.jpg"],
["../dynamicindex4/dog.jpg"] //<--no trailing comma after very last image element!
],
displaymode: {type:'auto', pause:2500, cycles:1, pauseonmouseover:true},
orientation: "h", //Valid values: "h" or "v"
persist: true, //remember last viewed slide and recall within same session?
slideduration: 300 //transition duration (milliseconds)
})

You can do:


var firstreel=new reelslideshow({
wrapperid: "myreel", //ID of blank DIV on page to house Slideshow
dimensions: [300, 200], //width/height of gallery in pixels. Should reflect dimensions of largest image
imagearray: [
["../dynamicindex4/fruits.jpg"],
["../dynamicindex4/pool.jpg", "http://en.wikipedia.org/wiki/Cave", "_new"],
["../dynamicindex4/autumn.jpg"],
["../dynamicindex4/dog.jpg"] //<--no trailing comma after very last image element!
],
displaymode: {type:'auto', pause:2500, cycles:2, pauseonmouseover:true},
orientation: "h", //Valid values: "h" or "v"
persist: true, //remember last viewed slide and recall within same session?
slideduration: 300 //transition duration (milliseconds)
});

jQuery(function($){
--firstreel.maxsteps;
});



The browser cache may need to be cleared and/or the page refreshed to see changes.

If you want more help, please include a link to the page on your site that contains the problematic code so we can check it out.

mattmac
10-12-2012, 03:53 PM
Thanks John, that works perfectly. I know I will be using this feature again.

mattmac
10-18-2012, 11:30 AM
Hi John

Another quick question regarding this script.

Is it possible to control the pause time of each individual slide, similar to the myfadeduration: [1, 100, 1500, 1500, 1500], used in fade slideshow?

keyboard
10-18-2012, 08:30 PM
Make the value in red higher to increase the amount of time for the slides to pause.

displaymode: {type:'auto', pause:2500, cycles:2, pauseonmouseover:true},

jscheuer1
10-18-2012, 10:52 PM
Well, yes unless you mean how to set a different pause value for each image. If that's the case, unlike the fadeslideshow, there's no convenient handle for that built into the reelslideshow script. One could probably be made fairly easily by editing the script. If that's what you want, let me know, I'll look into it.

jscheuer1
10-18-2012, 11:41 PM
Hmm, after rereading your post, I'm pretty sure that (individual pause rates for each slide) is what you're after. If so, use this modified version of the reelslideshow script:

4810

Use it in place of the official version. It then allows you to do like so (important features highlighted) in the on page new reelslideshow call:


<script type="text/javascript">

var firstreel=new reelslideshow({
wrapperid: "myreel", //ID of blank DIV on page to house Slideshow
dimensions: [300, 200], //width/height of gallery in pixels. Should reflect dimensions of largest image
imagearray: [
["http://i26.tinypic.com/11l7ls0.jpg"], //["image_path", "optional_link", "optional_target"]
["http://i29.tinypic.com/xp3hns.jpg", "http://en.wikipedia.org/wiki/Cave", "_new"],
["http://i30.tinypic.com/531q3n.jpg"],
["http://i31.tinypic.com/119w28m.jpg"] //<--no trailing comma after very last image element!
],
pausearray: [
1000,
4000,
2000,
5000
],
displaymode: {type:'auto', pause:2000, cycles:2, pauseonmouseover:true},
onslide: function(){
this.setting.displaymode.pause = this.setting.pausearray[this.curslide];
},
orientation: "h", //Valid values: "h" or "v"
persist: true, //remember last viewed slide and recall within same session?
slideduration: 300 //transition duration (milliseconds)
})

</script>

Notice that the pausearray has the same number of entries as the imagearray. Each pause in the pausearray will go with its corresponding image in the imagearray. Except that is for the first time for the first slide. It will use whatever pause is configured here:


displaymode: {type:'auto', pause:2000, cycles:2, pauseonmouseover:true},

mattmac
10-29-2012, 04:47 PM
That works a treat, the slideshow is even better now with real flexibility.

Thank you