Opens gallery in lightbox

Opens gallery in lightbox

to open the gallery in a lightbox after clicking a button or link, you need to add a class to the button that will be used as a trigger in the JavaScript code, in the options add an object with links to images

settings

lightbox_wrapp_classadds an extra class to lightbox wrappers
galleryThe URL of the images to display in the lightbox gallery
current_imgcurrent image can also be set

code

<button class="open-lightbox-button-class"> open gallery in lightbox </button>
jQuery('.open-lightbox-button-class').GreyOwlLightbox('click', {
     gallery : {
         1 : 'https://your.site/image-path/image-1.jpg',
         2 : 'https://your.site/image-path/image-2.jpg',
         3 : 'https://your.site/image-path/image-3.jpg',
     },
     current_img : 3,
     lightbox_wrapp_class : 'lightbox-gallery-content'
 });

example:

Leave a Reply

Your email address will not be published. Required fields are marked *