PDA

View Full Version : Ultimate Fade-in slideshow - disable fadein on first image in persistent mode



ndru83
07-01-2011, 11:35 AM
1) Script Title: Ultimate Fade-in slideshow

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

3) Describe problem:

Hi,

am using this script in persistent mode (remembers image last shown and goes on from last image) and would like it to behave in this way:

when I navigate between pages of site the slideshow always fades in the current image - undesirable for me. It should fade only between images in slideshow, but it should not fade in the very first image in persistent mode.

Am using this slideshow as a background in div behind textual content.

Am too stupid to change the code myself so I'd be most thankful if someone could help me.

Thx

ndru

jscheuer1
07-01-2011, 03:24 PM
Are your images all the same size and do you have the dimensions of the slideshow set to those dimensions? If so, just add this after the newfadeshow call:


;(function($, gal){
var set, id, num;
if((gal = window[gal]) && (num = fadeSlideShow.routines.getCookie("gallery-" + (id = (set = gal.setting).wrapperid)))){
$('head').append('<style type="text/css">#' + id + ', #' + id + ' .gallerylayer { background-image: url(' + set.imagearray[num][0] + ')!important;}</style>');
}
})(jQuery, 'mygallery');

where mygallery is the variable for that show, ex:


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", "#what", "", "<a style='color: #fff;' href='http://www.google.com/'>Nothing</a> 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:4000, cycles:0, wraparound:false},
persist: true, //remember last viewed slide and recall within same session?
fadeduration: 500, //transition duration (milliseconds)
descreveal: /apple|google/i.test(navigator.vendor)? "always" : "ondemand",
togglerid: ""
})
;(function($, gal){
var set, id, num;
if((gal = window[gal]) && (num = fadeSlideShow.routines.getCookie("gallery-" + (id = (set = gal.setting).wrapperid)))){
$('head').append('<style type="text/css">#' + id + ', #' + id + ' .gallerylayer { background-image: url(' + set.imagearray[num][0] + ')!important;}</style>');
}
})(jQuery, 'mygallery');

It will still fade in the very first time. That can be prevented as well if need be. But after the cookie is set, all subsequent loads will be without fade for the first image, whichever one it might be.

ndru83
07-02-2011, 08:26 AM
Works great. Thank you for your time, you're genius !