simpleLightbox icon indicating copy to clipboard operation
simpleLightbox copied to clipboard

Can't display caption when open Lightbox by JS

Open efolam opened this issue 5 years ago • 1 comments

How can I set caption to each image when I open Lightbox like this:

this.$lightbox.open({
  items: ['imageUrl1', 'imageUrl2', 'imageUrl3']
})

I tried do it so:

this.$lightbox.open({
  items: [
    {
      href: 'imageUrl1',
      title: 'caption 1'
    },
    {
      href: 'imageUrl2',
      title: 'caption 2'
    },
    {
      href: 'imageUrl3',
      title: 'caption 3'
    }
  ]
})

But it doesn't work

efolam avatar Jun 17 '20 09:06 efolam

Hello, it's as easy as dividing them: this.$lightbox.open({ items: [imageUrl1,imageUrl2], captions: ['caption1', 'caption2'] ] })

MrDanielPC avatar Aug 17 '20 09:08 MrDanielPC