Hello,
I am trying the following code in Code Injection:
<script src="https://hammerjs.github.io/dist/hammer.min.js"></script>
<script>
// Custom JavaScript code to enable pinch-to-zoom for Squarespace lightbox gallery
document.addEventListener('DOMContentLoaded', function () {
const lightboxImages = document.querySelectorAll('.gallery-masonry-lightbox-link img');
lightboxImages.forEach((image) => {
const hammertime = new Hammer(image);
hammertime.get('pinch').set({ enable: true });
});
});
</script>
However I do not know the precise handle to select the gallery-masonry-lightbox image in the querySelectorAll.
i.e. I would like to call the lightbox image, and unsure about this line in the code:
'.gallery-masonry-lightbox-link img'
I have also tried using the following inside the '', to no effect:
.gallery-lightbox-list .gallery-lightbox-item
.yui3-lightbox2
.sqs-mobile-web-content-editing
My aim is to open the image in lightbox and utilize pinch-to-zoom.
Any recommendations?
Thanks!