Closed stanley6631 closed 1 year ago
Hi,
You could add additional check in your Fancybox component and start Fancybox using
Fancybox.fromSelector('[data-fancybox]');
or
Fancybox.fromNodes(
Array.from(document.querySelectorAll('[data-fancybox="gallery"]')),
{
// Your custom options
}
);
See https://fancyapps.com/fancybox/getting-started/#additional-uses
Basically, there is no "right method", just check out API and use your imagination.
I have a fancybox integration with my vue 3 app, I need to send users a link to specific photos in gallery. There is obviously a fragment to every item, but it doesnt open since the component is not mounted on page load and needs to wait for the API response. Whats the best way to open a specific gallery item after the component mounts ?
This is my fancybox component:
This is how I use it in my view to create gallery: