PageSourceSearch

https://www.hortalizas.com/wp-content/themes/HortalizasTheme/js/lazy-load-images.js?ver=7.1.1

js hortalizas.com collected 2026-09-25 00:12:21 UTC 2,220 bytes, 63 lines download raw bytes

1(function($) {
2    document.addEventListener("DOMContentLoaded", function() {
3        var lazyloadImages;
4
5        function setIntersectionObserver() {
6            lazyloadImages = document.querySelectorAll(".lazy-img");
7            var imageObserver = new IntersectionObserver(function(entries, observer) {
8                entries.forEach(function(entry) {
9                    if (entry.isIntersecting) {
10                        var image = entry.target;
11                        image.src = image.dataset.src;
12                        image.classList.remove("lazy-img");
13                        imageObserver.unobserve(image);
14                    }
15                });
16            });
17
18            for (var i = 0; i < lazyloadImages.length; i++) {
19                imageObserver.observe(lazyloadImages[i]);
20            }
21        }
22
23        function lazyload() {
24            lazyloadImages = document.querySelectorAll(".lazy-img");
25
26            if (lazyloadThrottleTimeout) {
27                clearTimeout(lazyloadThrottleTimeout);
28            }
29
30            lazyloadThrottleTimeout = setTimeout(function() {
31                var scrollTop = window.pageYOffset;
32                for (var i = 0; i < lazyloadImages.length; i++) {
33                    var img = lazyloadImages[i];
34                    if (img.offsetTop < (window.innerHeight + scrollTop)) {
35                        img.src = img.dataset.src;
36                        img.classList.remove('lazy-img');
37                    }
38                }
39            }, 20);
40        }
41
42        $(document).on('reaload-lazy-load-images', function(){
43            if ("IntersectionObserver" in window) {
44                setIntersectionObserver();
45            }
46            else {
47                lazyload();
48            }
49        });
50
51        if ("IntersectionObserver" in window) {
52            setIntersectionObserver();
53        } else {
54            var lazyloadThrottleTimeout;
55
56            lazyload();
57
58            document.addEventListener("scroll", lazyload);
59            window.addEventListener("resize", lazyload);
60            window.addEventListener("orientationChange", lazyload);
61        }
62    })
63})(jQuery);

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.