How to get data from the triggering item #21
-
Hi, Loving the new version! For example <div class="flex flex-wrap gap-5 justify-center max-w-5xl mx-auto px-6">
<a data-fancybox="gallery" data-id="5" href="https://lipsum.app/id/63/800x600">
<img class="rounded" src="https://lipsum.app/id/63/200x150" />
</a>
<a data-fancybox="gallery" data-id="6" href="https://lipsum.app/id/64/800x600">
<img class="rounded" src="https://lipsum.app/id/64/200x150" />
</a>
</div> In the Am I missing something in the docs ? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Hi, It would be like this: Fancybox.bind('[data-fancybox="gallery"]', {
on : {
initLayout : (fancybox) => {
console.log(fancybox.options.$trigger);
}
}
}); Sorry, the docs are not complete yet. I am also planning to create a tutorial that would cover frequently asked questions. |
Beta Was this translation helpful? Give feedback.
Hi,
It would be like this:
Sorry, the docs are not complete yet. I am also planning to create a tutorial that would cover frequently asked questions.