dimsemenov / PhotoSwipe

JavaScript image gallery for mobile and desktop, modular, framework independent
http://photoswipe.com
MIT License
24.18k stars 3.31k forks source link

v5-beta custom html data-attribute on element #1779

Open marwl opened 3 years ago

marwl commented 3 years ago

Hi, I tried out v5-beta and it looks great! One small thing though. It would be really nice if photoswipe could pick up the data-pswp-html attribute from the element, the same way it's handled in the array datasource. Thanks

marwl commented 3 years ago

For the meantime I am using: lightbox.on('itemData', (e) => { e.itemData.html = e.itemData.element.dataset.pswpHtml; });

acwolff commented 3 years ago

I support this request!

mattneal-stafflink commented 3 years ago

Same. I'd love to more easily add HTML to a gallery if possible.