How do I add a description (and title, etc.) via the API? The examples all appear to be data- attributes
import 'https://cdn.jsdelivr.net/gh/mcstudios/glightbox/dist/js/glightbox.min.js';
var exampleApi = GLightbox({ selector: null });
fetch('https://dummyjson.com/products')
.then(response => response.json())
.then(data => {
data.products.forEach(product => {
product.images.forEach( i => {
exampleApi.insertSlide({
href: i,
// content: '<p>some html to append in the slide</p>',
// description: "A description"
});
})
});
exampleApi.open();
})
.catch(err => console.error(err))
How do I add a description (and title, etc.) via the API? The examples all appear to be data- attributes