0

I want to add custom html in lightbox2 caption code using different attributes. I want to add URL, Product name and product code.

This is my gallery.

http://psd2htmlexpert.com/work/cs-gallery/

I can just add simple text in caption.

Thanks in advance. Here is an example of what i want.

http://temp.simpleidea.us/cs-gallery/gallery.html

Shobi
  • 41
  • 6
  • It seems you need to edit the library's source: http://stackoverflow.com/questions/11119879/turning-caption-into-a-link-doesnt-work-in-lightbox-2-51 – James Hibbard Jan 18 '15 at 18:28
  • yes you are right. but I don't have much knowledge to do this :( i try it but everything got messed. – Shobi Jan 18 '15 at 18:32

1 Answers1

0

A bit of Googling and it seems that this has been added to the latest version of Lightbox 2. Here's the issue on the project's homepage.

So, for you that means, update your Lightbox version, then you can do:

<a href="images/1.jpg" data-lightbox="gallery" data-title="<a href='http://google.com'>Link to google</a>. More text.">
  <img class='item' src='images/thumbs/1.jpg' />
  <span class='caption'>
    <span class='icon fa fa-search'></span>
  </span>
</a>

Here's a demo

James Hibbard
  • 16,490
  • 14
  • 62
  • 74