PDA

View Full Version : fade slide show, description default closed?



noonan
03-25-2010, 07:01 PM
i am using the fadeslideshow.js with the descreveal setting of always, with an info button toggle. does anyone know how to modify the files so the description defaults in the closed position. i know there is also the ondemand option but we find the whole image as a roll-over to be distracting. thanks.

jscheuer1
03-26-2010, 03:24 AM
You don't really need to modify the files for this. You can just add an oninit function to the on page call. Like the one on the demo page that uses descriptions always looks like so:


var mygallery2=new fadeSlideShow({
wrapperid: "fadeshow2", //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:'manual', pause:2500, cycles:0, wraparound:false},
persist: false, //remember last viewed slide and recall within same session?
fadeduration: 500, //transition duration (milliseconds)
descreveal: "always",
togglerid: "fadeshow2toggler"
})

You may have even used it as a template for your slide show. In any case, just add the highlighted:


var mygallery2=new fadeSlideShow({
wrapperid: "fadeshow2", //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:'manual', pause:2500, cycles:0, wraparound:false},
persist: false, //remember last viewed slide and recall within same session?
fadeduration: 500, //transition duration (milliseconds)
descreveal: "always",
togglerid: "fadeshow2toggler",
oninit: function(){
var save = fadeSlideShow_descpanel.slidespeed;
fadeSlideShow_descpanel.slidespeed = 0;
this.showhidedescpanel('hide');
fadeSlideShow_descpanel.slidespeed = save;
}
})

Be sure not to miss the added comma (red) after the togglerid declaration.