PhotoSwipe icon indicating copy to clipboard operation
PhotoSwipe copied to clipboard

Multiple gallery

Open levipadre opened this issue 5 years ago • 3 comments

Thanks for the great plugin. I know there is an example of multiple gallery, so I know it should work, but for some reason I can't make it right. https://codepen.io/levipadre/pen/xxVGeRK

The galerries are actually working, but act as one. A little help would be really great. Thanks!

levipadre avatar Aug 13 '20 07:08 levipadre

Both have same class so all pictures get added by

var gallery = document.querySelectorAll('.gallery');

andi34 avatar Aug 19 '20 04:08 andi34

Maybe helps: https://github.com/andi34/photobooth/blob/dev/src/js/photoinit.js

If I am not wrong, you could init for each query selector simply by:

initPhotoSwipeFromDOM('.gallery1');
initPhotoSwipeFromDOM('.gallery2');

(Haven't tested to use multiple galleries)

andi34 avatar Aug 19 '20 04:08 andi34

https://github.com/dimsemenov/PhotoSwipe/issues/1631

andi34 avatar Aug 20 '20 20:08 andi34