Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't display caption when open Lightbox by JS #20

Open
efolam opened this issue Jun 17, 2020 · 1 comment
Open

Can't display caption when open Lightbox by JS #20

efolam opened this issue Jun 17, 2020 · 1 comment

Comments

@efolam
Copy link

efolam commented Jun 17, 2020

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

@MrDanielPC
Copy link

MrDanielPC commented Aug 17, 2020

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants