// == Universal Squarespace Hover Zoom Disable ==
(function() {
// 1. Prevent the gallery from triggering zoom events
document.querySelectorAll('.ProductItem-gallery, .product-gallery').forEach(gallery => {
gallery.addEventListener('mouseenter', e => e.stopPropagation(), true);
gallery.addEventListener('mousemove', e => e.stopPropagation(), true);
});
// 2. Immediately remove any zoom duplicate divs
const removeZoomDuplicates = node => {
if (node.classList node.classList.contains('product-image-zoom-duplicate')) {
node.remove();
}
};
// 3. MutationObserver to catch dynamically added zoom duplicates
const observer = new MutationObserver(mutations => {
mutations.forEach(mutation => {
mutation.addedNodes.forEach(removeZoomDuplicates);
});
});
observer.observe(document.body, { childList: true, subtree: true });
// 4. Also remove any existing duplicates on page load
document.querySelectorAll('.product-image-zoom-duplicate').forEach(removeZoomDuplicates);
})();