There's an undocumented oninit feature to this script which may be set in the on page call, example:
Code:
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:0, wraparound:false},
persist: false, //remember last viewed slide and recall within same session?
fadeduration: 500, //transition duration (milliseconds)
descreveal: "ondemand",
togglerid: "",
oninit: function(){
var s = this.setting;
s.$gallerylayers.bind('click', function(){
alert(s.curimage);
});
}
})
Don't miss the added comma (red) after the togglerid property. Notice the:
That will fire each time an image is clicked alerting the 0 based index of which image it is. Change the alert to your pop up function. You don't have to bind to a click of the images (the layer container actually here, amounts to the same thing). You could bind to whatever you like:
Code:
oninit: function(){
var s = this.setting;
jQuery('#mybutton').bind('click', function(){
alert(s.curimage);
});
}
That would allow you to have a button with the id 'mybutton' to trigger this.
Or simply set a global using the onslide (another undocumented feature) function instead:
Code:
onslide: function(layer, idx){
window.slideNum = idx;
}
That will set slideNum to this same zero based index. It will then be available in the global scope, so you could have a button somewhere with this onclick event:
Code:
onclick="if(typeof slideNum === 'number') popup(slideNum);"
There are various ways.
Bookmarks