Events
The events you can listen to:
Prop | When is it fired? |
---|---|
onOpen | On every open of the lightbox. |
onClose | On every close of the lightbox. |
onInit | On the initial open of the lightbox. |
onShow | On every open of the lightbox excluding the initial open. |
onSlideChange Pro | On every slide change of the lightbox. |
To listen to an event, set a desired function to the appropriate prop. The lightbox's instance will be passed as an argument.
<FsLightbox
onSlideChange={(instance) => console.log(instance)}
/>