1(function () { 2 function fixSwiperLazy(img) { 3 if (img.dataset && img.dataset.src) { 4 img.src = img.dataset.src; 5 img.classList.remove("swiper-lazy"); 6 img.removeAttribute("data-src"); 7 8 // Wait for image to fully load before removing preloader 9 img.addEventListener("load", function () { 10 const preloader = img 11 .closest(".swiper-zoom-container") 12 ?.querySelector(".swiper-lazy-preloader"); 13 if (preloader) preloader.remove(); 14 }); 15 } 16 } 17 18 function fixAllExisting() { 19 document.querySelectorAll("img.swiper-lazy").forEach(fixSwiperLazy); 20 } 21 22 // Run initially on page load 23 document.addEventListener("DOMContentLoaded", fixAllExisting); 24 25 // Observe for dynamically added lazy images 26 const observer = new MutationObserver(function (mutations) { 27 mutations.forEach(function (mutation) { 28 mutation.addedNodes.forEach(function (node) { 29 if (node.nodeType === 1) { 30 if (node.matches("img.swiper-lazy")) { 31 fixSwiperLazy(node); 32 } 33 34 node.querySelectorAll?.("img.swiper-lazy").forEach( 35 fixSwiperLazy 36 ); 37 } 38 }); 39 }); 40 }); 41 42 observer.observe(document.body, { 43 childList: true, 44 subtree: true, 45 }); 46})();
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.