Using Lightbox for a photo gallery and would like to initiate the function by clicking on the thumbnail’s parent <li>rather than the thumbnail image. I have been able to do this easily with the thumbnail for the album (not using Lightbox, simply opening another page) with the following code:
$(".item").click(function(){
window.location=$(this).find("a").attr("href");return false;
});
However, can’t seem to initiate Lightbox in a similar fashion. Ideas?
Thanks!
UPDATE
I am using jQuery Lightbox (0.5), http://leandrovieira.com/projects/jquery/lightbox/
Here is the code to initiate:
$('a.lightbox').lightBox();
And the HTML (with PHP for details):
<a href="http://somewhere.com/gallery/photos/<?php echo $images['filename'];?>.jpg" class="lightbox" title="<?php echo $images['caption'];?>">
You could catch the click of the
<li>and then invoke the click event of the first<img>inside that<li>with the following code. But this is very hacky, and I do not recommend it. It would help to know which lightbox you’re using (there are many), and see some HTML.