natural-gallery-js
natural-gallery-js copied to clipboard
Ability to customize gallery items
Hi. I noticed that currently is quite hard to do any customization on gallery items. I need to add a button to each image and I thought about two solutions:
Modify 'item-added-to-dom'
event so it returns also item.element
instead only item.model
,
or make a custom method in Item class similar to what photoSwipe did:
photoSwipe.pswp.ui.registerElement({
name: "test-button",
ariaLabel: "Add to favs",
order: 9,
isButton: true,
html: '<i class="bi bi-heart" style="text-shadow: 2px 2px 5px black;"></i>',
onClick: (event, el) => {
addToFavs(event, el)
},
});