The gallerize directive is used to create lightbox gallery from image elements or
gallery components.
This directive loads the images in the gallery automatically, you don't need to load them manually.
Gallerize has 2 modes:
-
If used on
HTMLElement, it detects the images and hooks their clicks to the lightbox. -
If used on
'">, it hooks the images click to the lightbox.
If you haven't installed the module in step 1 see the Getting Started Guide
There are use cases when images are received as HTML format, this directive takes the headache of fetching the src paths for you and connect them automatically to the lightbox.
Basic example
By default, Gallerize will process all img elements, but you can limit that to elements with a specific selector.
Selector example
Detect background images of elements with selector .gallery-img
'"> ComponentGallerize is also compatible with the '"> component, if you
want to trigger the lightbox on a gallery item's click, just add gallerize on your
gallery component.