rendering1 [메모] lazy loading with intersectionObserver, 로더, localstorage const loadLazyImages = (entries, observer) => { entries.forEach(function (entry) { if (entry.isIntersecting) { console.log('loadLazyImages', entry.target.dataset.src, 'fetch data'); let lazyImage = entry.target; lazyImage.src = lazyImage.dataset.src; // lazyImage.srcset = lazyImage.dataset.srcset; lazyImage.classList.remove('lazy'); observer.unobserve(lazyImage); } }); co.. 2022. 10. 10. 이전 1 다음