PageSourceSearch

https://blog.lmorchard.com/js/media-lazy-loader.js

js lmorchard.com collected 2026-09-25 03:57:35 UTC 632 bytes, 19 lines download raw bytes

1import "./vendor/lazyload.js";
2
3// Set up the magical header that changes on scroll.
4var HEADER_CHANGE_DISTANCE = 30;
5window.addEventListener('scroll', function (e) {
6    var distanceY = window.pageYOffset || document.documentElement.scrollTop;
7    if (distanceY > HEADER_CHANGE_DISTANCE) {
8        document.body.classList.add('scrolled');
9    } else {
10        document.body.classList.remove('scrolled');
11    }
12});
13
14// Activate lazyloading on needful elements
15var toLazyLoad = document.querySelectorAll('.lazyload');
16for (var idx = 0; idx < toLazyLoad.length; idx++) {
17    console.log(toLazyLoad[idx]);
18    lzld(toLazyLoad[idx]);
19}

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.