1// Select all elements with the .hd-block-images-overlap class 2const image_overlaps = document.querySelectorAll('.hd-block-images-overlap'); 3 4// Define the observer overlap_options 5const overlap_options = { 6 root: null, // Use the viewport as the root 7 rootMargin: '0px', // No margin around the root 8 threshold: 0.9 // Trigger when 10% of the element is visible 9}; 10 11// Define the callback function 12const overlap_observerCallback = (entries, observer) => { 13 entries.forEach(entry => { 14 if (entry.isIntersecting) { 15 entry.target.classList.add('in-view'); 16 // Optionally stop observing if you only want to add the class once 17 observer.unobserve(entry.target); 18 } 19 }); 20}; 21 22// Create the observer 23const overlap_observer = new IntersectionObserver(overlap_observerCallback, overlap_options); 24 25// Start observing each target element 26image_overlaps.forEach(target => overlap_observer.observe(target));
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.