PDA

View Full Version : Ultimate Fade-in slideshow 2.1



atgardmedia
09-15-2010, 08:19 PM
Hi!

I want to open a shadowbox (http://www.shadowbox-js.com/) window as a link on a picture from the
(Ultimate Fade-in slideshow (http://www.dynamicdrive.com/dynamicindex14/fadeinslideshow.htm) code.

Im not a hacker but tried this:

Building my array in my html file:


imagearray: [
["image_1.jpg", "http://en.wikipedia.org/wiki/Cave", "_new", "Valbar text."],
["image_2.jpg", "http://en.wikipedia.org/wiki/Cave", "shadowbox", "Valbar text."] //<--no trailing comma after very last image element!
],


Note the shadowbox on image_2


Edeting my fadeinslideshow.js file


fadeSlideShow.routines={

getSlideHTML:function(imgelement){
if (imgelement[2] == "shadowbox") {
var layerHTML=(imgelement[1])? '<a href="'+imgelement[1]+'" rel="shadowbox;width=950;height=600;">\n' : ''
}
else {
var layerHTML=(imgelement[1])? '<a href="'+imgelement[1]+'" target="'+imgelement[2]+'">\n' : ''
}
layerHTML+='<img src="'+imgelement[0]+'" style="border-width:0;" />\n'
layerHTML+=(imgelement[1])? '</a>\n' : ''
return layerHTML //return HTML for this layer
},

getFullHTML:function(imagearray){
var preloadhtml=''
for (var i=0; i<imagearray.length; i++)
preloadhtml+=this.getSlideHTML(imagearray[i])
return preloadhtml
},


Note:
My edit is in the getSlideHTML function.. the if and else statment.
Else-code is original code.
The if statement is suppose to generat a target= or rel= depending on input in html file.

So.. Im just simply trying to create the REL thing direcly in the generated html code. All working except for the REL thing so no shadowbox opens.
I suppose i have to let the fadeinslideshow script know about the shadowbox functions somehow and somewhere?
Ofcource my html is setup for shadowbox and works there on other links.

Hope some one can hint me!?
Or how i should do this diffrent?

(I do see now that there is a 2.4 version out.. but this post is 2.1 code)
(Also.. will fix the size of the shadowbox to be dynamic after getting it to wor in the first place)

Thnx in advance..

atgardmedia
09-15-2010, 08:34 PM
oh.. very poor subject.. can i change?
sorry..