Sure. It would be easier if you had a naming convention. Like:
bw_whatever.jpg - for the black and white version
and:
whatever.jpg - for the color version
Do you already have the images and are they kind of like that, with just a little difference between the filename for each set? If you do, we can tweak what follows to conform to it. For now I'm going to write it as though the files are named as in the example above.
So for the init of the slideshow, put like:
Code:
var mygallery=new fadeSlideShow({
wrapperid: "fadeshow1", //ID of blank DIV on page to house Slideshow
dimensions: [470, 502], //width/height of gallery in pixels. Should reflect dimensions of largest image
imagearray: [
["bw_whatever.jpg"],
["bw_next.jpg"],
["bw_another.jpg"],
["bw_yet_another.jpg"] //<--no trailing comma after very last image element!
],
displaymode: {type:'auto', pause:4000, cycles:0, wraparound:false},
persist: false, //remember last viewed slide and recall within same session?
fadeduration: 500, //transition duration (milliseconds)
descreveal: "never",
togglerid: "",
oninit: function(){
var $ = jQuery, s = this.setting, w = s.$wrapperdiv.get(0), i, re = /bw_/, m, operaVersion = 7;
s.$gallerylayers.find('img').each(function(){
$(this).addClass('domroll ' + this.src.replace(re, ''));
});
(function() {
if (window.opera) {
operaVersion = parseInt(navigator.userAgent.match(/Opera (\S+)/)[1]);
}
if (!document.getElementById||operaVersion <7) return;
var imgarr=w.getElementsByTagName('img');
var imgPreload=[];
var imgSrc=[];
var imgClass=[];
for (i=0;i<imgarr.length;i++){
if (imgarr[i].className.indexOf('domroll')!=-1){
imgSrc[i]=imgarr[i].getAttribute('src');
imgClass[i]=imgarr[i].className;
imgPreload[i]=new Image();
if ((m = imgClass[i].match(/domroll (\S+)/))) {
imgPreload[i].src = m[1]
}
imgarr[i].setAttribute('xsrc', imgSrc[i]);
imgarr[i].onmouseover=function(){
this.setAttribute('src', this.className.match(/domroll (\S+)/)[1]);
}
imgarr[i].onmouseout=function(){
this.setAttribute('src', this.getAttribute('xsrc'));
}
}
}
})();
}
})
Untested. If there are problems and you want more help:
Please post a link to a page on your site that contains the problematic code so we can check it out.
Edit: Note: I've corrected this code as per the problem identified in the following two posts in this thread (#3 and #4), so it's now tested and works.
Bookmarks