turning caption into a link doesn't work in Lightbox 2.51

user860644 picture user860644 · Jun 20, 2012 · Viewed 7.5k times · Source

Turning a caption into a link doesn't work in Lightbox 2.51 downloaded from here
Here is the code:

<a href="images/examples/image-1.jpg" rel="lightbox" 
  title="&lt;a target='_self' href='http://www.google.com'&gt;Google&lt;/a&gt;">
  <img src="images/examples/thumb-1.jpg" alt="" />
</a>

What should I do?
Thanks :)

Answer

Rafael Rudnik picture Rafael Rudnik · Nov 20, 2012

I found a solution for this problem in the lightbox.js. You must edit the if case, adding the else condition that avoid always return false when you click in the div "lightbox" .

 $lightbox.hide().on('click', function(e) {
    if ($(e.target).attr('id') === 'lightbox') { 
        _this.end();
        return false;
    }
    else { // HERE
        return true; 
    }
  });