PageSourceSearch

https://artisticflowerarrangements.com/wp-content/plugins/related-…/assets/js/lazy-load.js?ver=4.3.1

js artisticflowerarrangements.com collected 2026-10-06 13:24:42 UTC 1,482 bytes, 39 lines download raw bytes

1/**
2 * Lazy Load Script
3 *
4 * This script is responsible for lazy loading images and background images
5 * for elements with the classes "rpt-lazyload" and "lazy-load". It uses
6 * the IntersectionObserver API to efficiently load images as they enter
7 * the viewport.
8 */
9
10document.addEventListener("DOMContentLoaded", function() {
11    var lazyloadElements = document.querySelectorAll(".rpt-lazyload, .lazy-load");
12
13    if ("IntersectionObserver" in window) {
14        var imageObserver = new IntersectionObserver(function(entries, observer) {
15            entries.forEach(function(entry) {
16                if (entry.isIntersecting) {
17                    var element = entry.target;
18
19                    if (element.classList.contains('rpt-lazyload')) {
20                        // Handle background images
21                        var imageUrl = element.dataset.bg;
22                        element.style.backgroundImage = 'url(' + imageUrl + ')';
23                    } else if (element.classList.contains('lazy-load')) {
24                        // Handle <img> tags
25                        var imageUrl = element.dataset.src;
26                        element.src = imageUrl;
27                    }
28
29                    element.classList.remove("rpt-lazyload", "lazy-load");
30                    observer.unobserve(element);
31                }
32            });
33        });
34
35        lazyloadElements.forEach(function(element) {
36            imageObserver.observe(element);
37        });
38    }
39});

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.