Results 1 to 2 of 2

Thread: Lightbox Caption Link without Upgrading...

  1. #1
    Join Date
    Sep 2008
    Posts
    3
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Question Lightbox Caption Link without Upgrading...

    Lightbox Image Viewer

    http://www.dynamicdrive.com/dynamici...tbox/index.htm

    Hi everyone,

    I'm using the original lightbox, which is perfect for my needs EXCEPT that I would like to take advantage of the feature to hyperlink the caption text.

    I've added this snippet to my javascript file:

    function getImageTitle(anchor){ //DynamicDrive.com added function that allows the caption("title") to be linked ("rev").
    var ddimageTitle=anchor.getAttribute('title')
    var ddimageTitleURL=(ddimageTitle!=null && ddimageTitle!="")? anchor.getAttribute('rev') : null
    return ddimageTitleFinal=(ddimageTitleURL!=null && ddimageTitleURL!="")? '<a href="'+ddimageTitleURL+'" class="ddcaptionurl">'+ddimageTitle+'</a>' : ddimageTitle
    };

    and added the "rev" tag to my anchor tag on the webpage, but nothing's happening. I'm no javascript pro- am I missing anything? Is there competing code in the original lightbox script?

    The only major tweak to the original code was to remove hideLightBox everywhere except for the close button. Everything else is working perfectly, it's just that the caption text isn't linked.

    Thanks for your help.

  2. #2
    Join Date
    Sep 2008
    Posts
    3
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Default oops- never mind

    I found a work-around in this thread:

    http://www.dynamicdrive.com/forums/s...ad.php?t=20140

    Thanks anyway

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
  •