Open w3b3 opened 5 years ago
const observer = new IntersectionObserver(function(records, observer) { records.forEach(function(record) { const el = record.target; if (!el.src && record.isIntersecting) { el.src = el.dataset.src; delete el.dataset.src; observer.unobserve(el); } });
I wonder if it's interesting to have a more aggressive lazy-load strategy for images if the user is on mobile. If it's a desktop, most likely the network conditions are better (as it is the computing power)