Launch lightbox in jQuery by clicking on the button

to start the lightbox in jquery you have to click on one image ('a') of the gallery and then start the lightbox ....

$('#gallery a').lightBox();

but I'm going to use the lightbox as a zoom, this means that I have a "ZOOM" button, by clicking this button, I'm going to open my gallery ...

I do not know how I can do this ...

+5
source share
1 answer

you can use:

     $('#gallery a').lightBox();
     $('#zoomButton').click(function(){
         $('#gallery a:first').click();
    })

Or maybe

$('#gallery a:first').trigger();

Unconfirmed but should work

+6
source

All Articles