Making JQuery LightBox Plugin work with multiple galleries

Posted by lpdahito on Stack Overflow See other posts from Stack Overflow or by lpdahito
Published on 2010-01-12T18:18:45Z Indexed on 2010/05/11 4:04 UTC
Read the original article Hit count: 286

Filed under:
|
|
|
|

Hi guys... I'm trying to make this jquery plugin => http://leandrovieira.com/projects/jquery/lightbox/ work with multiple galleries on the same page.

The problem is, everytime I click on a picture from a certain gallery, I get all the pictures from all the galleries on the same page. Let's say i've got 2 galleries of 6 photos each. If I click on a pic from gallery 1, I will see the pics from gallery 2 as well.

I've tried something like this to make it work but no success:

<script type="text/javascript">
    $(function(){
      $('div.gallery-6').each(function() {
        $(this).find('a.lightbox').lightBox();
      });
    });
</script>

Unfortunately, it doesn't work!!!

What's the workaround for that?

Once again, what I'm trying to accomplish is to be able to view the pictures in their proper gallery. I don't want all the pics to be treated as one gallery.

Thanks for your help guys.

LP

© Stack Overflow or respective owner

Related posts about jQuery

Related posts about lightbox