PageSourceSearch

https://fishport.com/local/templates/fish/components/bitrix/news.list/home-slider/script.js

js fishport.com collected 2026-10-09 23:47:10 UTC 748 bytes, 29 lines download raw bytes

1// загрузка изображений только тогда, когда они находятся в области видимости
2const lazyImages = document.querySelectorAll('.banner_item.lazy');
3
4const options = {
5  root: null,
6  rootMargin: '0px',
7  threshold: 0.1,
8};
9
10const lazyLoad = (image) => {
11  const src = image.dataset.src;
12  if (src) {
13    image.src = src;
14    image.classList.remove('lazy');
15  }
16};
17
18const imageObserver = new IntersectionObserver((entries, observer) => {
19  entries.forEach(entry => {
20    if (entry.isIntersecting) {
21      lazyLoad(entry.target);
22      observer.unobserve(entry.target);
23    }
24  });
25}, options);
26
27lazyImages.forEach(image => {
28  imageObserver.observe(image);
29});

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.