Results 1 to 2 of 2

Thread: lightbox captions ?

  1. #1
    Join Date
    Nov 2008
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default lightbox captions ?

    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

  2. #2
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    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 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:

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

    Code:
    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:

    Code:
    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
    }
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •