PDA

View Full Version : lightbox captions ?



jackburton1975
11-20-2008, 05:54 PM
Hey guys,

I used both scripts in conjunction with php and it works just fine.

One glitch: I'd love to have captions undearneath the lightbox-opened photos but I'm not fluent in Javasctipt and I don't know how to pass the "caption" variable ..

can anyone help , please ?

thank you

dave

jscheuer1
11-20-2008, 06:50 PM
In future, please post new questions in a new thread like here where I've moved this, and:

Warning: Please include a link to the DD script in question in your post. See this thread (http://www.dynamicdrive.com/forums/showthread.php?t=6) for the proper posting format when asking a question.

I can say that for passing a title attribute (used by lightbox for its caption), you would either need another script or a modification. There have been mods for U Fade that pass title attributes to the images, but you need to pass it to the link. The concept could be adapted and is fairly simple, but you would also need to work out how to get the info into the new array structure we will make. Since I don't know how you are doing that for the rest of the stuff, I'll let you work that out if you can.

Example new array structure for U fade:


fadeimages[1]=["photo2.jpg", "photo2_lrg.jpg", "", "My Title/Caption"] //image with link

Then here:


fadeshow.prototype.populateslide=function(picobj, picindex){
var slideHTML=""
if (this.theimages[picindex][1]!="") //if associated link exists for image
slideHTML='<a href="'+this.theimages[picindex][1]+'" rel="lightbox" target="'+this.theimages[picindex][2]+'">'
slideHTML+='<img src="'+this.postimages[picindex].src+'" border="'+this.imageborder+'px">'
if (this.theimages[picindex][1]!="") //if associated link exists for image
slideHTML+='</a>'
picobj.innerHTML=slideHTML
}

add:


fadeshow.prototype.populateslide=function(picobj, picindex){
var slideHTML=""
if (this.theimages[picindex][1]!="") //if associated link exists for image
slideHTML='<a title="'+(this.theimages[picindex][3]? this.theimages[picindex][3] : '')+'" href="'+this.theimages[picindex][1]+'" rel="lightbox" target="'+this.theimages[picindex][2]+'">'
slideHTML+='<img src="'+this.postimages[picindex].src+'" border="'+this.imageborder+'px">'
if (this.theimages[picindex][1]!="") //if associated link exists for image
slideHTML+='</a>'
picobj.innerHTML=slideHTML
}