Glossary Term
Lazy Loading
Lazy loading is a technique that defers loading images, videos, or content sections until they are about to become visible in the viewport — improving initial page load performance.
How lazy loading works
Without lazy loading, a browser downloads every image, video, and resource on a page as soon as the HTML is parsed — even if those resources are far below the fold and may never be seen. On a long page with dozens of images, this wastes bandwidth and delays the time until the page becomes interactive.
Lazy loading changes this behavior by deferring resource loading until the element is near the viewport. The two most common implementations are:
Native lazy loading uses the loading="lazy" attribute on <img> and <iframe> elements. The browser handles the timing internally — it begins fetching the resource when it calculates that the element is approaching the visible area. No JavaScript is required.
Intersection Observer API provides programmatic control. A JavaScript observer watches target elements and fires a callback when they enter or approach the viewport. The callback then sets the actual src attribute (replacing a placeholder or data attribute), triggering the download. This approach allows custom thresholds, animation triggers, and more granular control over when loading begins.
Both approaches achieve the same goal: the page loads faster because only above-the-fold content is fetched immediately, and remaining resources load on demand as the user scrolls.
Lazy loading and screenshots
Lazy loading creates a specific challenge for screenshot capture. When a tool requests a full-page screenshot, it typically renders the page at the top of the viewport and captures the entire document height in a single pass. Lazy-loaded elements below the fold have not been triggered, so they appear as empty containers, placeholder images, or low-resolution thumbnails.
The solution is to scroll the page programmatically before capturing. A headless browser script can scroll from top to bottom in increments, pausing at each step to let the Intersection Observer callbacks fire and images load. After reaching the bottom, the script scrolls back to the top and captures the now-fully-loaded page.
Some screenshot tools handle this automatically — detecting lazy-loaded elements and scrolling through the page as part of the capture pipeline. This produces clean full-page screenshots without manual intervention.
Detecting lazy-loaded content
Identifying whether a page uses lazy loading helps you decide how to capture it. Look for these indicators:
loading="lazy"attributes on<img>and<iframe>tags — the native browser implementation.data-srcordata-lazyattributes — a common pattern where the actual image URL is stored in a data attribute and swapped intosrcby JavaScript when the element enters the viewport.- Placeholder images — small, blurred, or solid-color images that are replaced with the full image on scroll.
- Intersection Observer usage — check the page's JavaScript for
IntersectionObserverinstances watching image or content elements. - Framework-specific components — React's
lazy(), Next.jsImagecomponent, and similar framework utilities implement lazy loading by default.
Common mistakes
- Not scrolling before capturing. The most common screenshot issue with lazy-loaded pages. If the capture tool does not scroll through the page first, below-the-fold images will be missing from the output.
- Setting the loading threshold too high. If lazy loading triggers only when an element is already visible, users see a flash of empty space before the image appears. Set the threshold to begin loading slightly before the element enters the viewport.
- Lazy loading above-the-fold content. Images and content visible on initial page load should never be lazy loaded — it delays what users see first and hurts Largest Contentful Paint scores. Only defer resources below the fold.
- Forgetting fallbacks for JavaScript-disabled environments. If lazy loading relies entirely on JavaScript, users and crawlers with JavaScript disabled will see no images at all. Use
<noscript>fallbacks or nativeloading="lazy"as a baseline.
Common Questions
How does lazy loading affect screenshots?
Lazy-loaded images and content sections only load when they enter (or approach) the viewport. A screenshot captured without scrolling or triggering these elements will show placeholders, blank spaces, or low-resolution thumbnails instead of the actual content.
Can I capture a full-page screenshot of a page that uses lazy loading?
Yes, but the capture tool must scroll through the entire page first to trigger all lazy-loaded elements. Many screenshot tools and headless browser scripts include an auto-scroll step that forces all deferred content to load before capturing.
What is the difference between lazy loading and infinite scroll?
Lazy loading defers resources that already exist on the page until they approach the viewport. Infinite scroll loads entirely new content (new items, new pages) as the user scrolls to the bottom. Both defer loading, but infinite scroll adds content that was not in the original page structure.
Does lazy loading improve SEO?
Lazy loading can improve Core Web Vitals scores (especially Largest Contentful Paint) by reducing initial load time, which indirectly benefits SEO. However, content that is never rendered because of poor lazy loading implementation may not be indexed by search engines.
How do I implement lazy loading?
The simplest method is the native loading='lazy' attribute on img and iframe elements. For more control, the Intersection Observer API lets you detect when elements enter the viewport and trigger loading programmatically. Many frameworks (React, Next.js, Nuxt) include built-in lazy loading components.
Sources
- Lazy loading — MDN Web Docs
- Browser-level image lazy-loading for the web — web.dev
Related Resources
Website capture workflows
Website Screenshot Automation for Mac
Capture website screenshots automatically on Mac for URL lists, QA checks, client updates, recurring audits, and visual archives.
Blog
Best Screenshot Automation Tools in 2026: Which Should You Use?
Compare Shotomatic, Snagit, and CleanShot X for automated screenshots, website capture, OCR, timelapses, and documentation workflows on Mac.