Closed shaunrobinson closed 1 day ago
@shaunrobinson Yeah this is possible if you pass the images as objects and set lazy: true
.
Can you give me some example code to do this? Thanks!
@shaunrobinson Sure, something like:
<div
x-data="{
images: [
{ url: 'image-1.jpg', lazy: true },
{ url: 'image-2.jpg', lazy: true },
{ url: 'image-3.jpg', lazy: true },
],
}"
x-init="$lightbox(images)"
>
...
</div>
Perfect, thanks!
Just checking I haven't missed something obvious - is it possible to lazy load the images when using $lightbox?
If so, how would you change your demo code to do this?