Echo is a standalone JavaScript lazy-loading image micro-library that uses HTML5 data-* attributes to defer image loading until needed.
The tool solves the problem of loading all images on page load, which wastes bandwidth and slows initial rendering. Echo defers image loading until images approach the viewport, loading them only when needed. It works by reading image URLs from data-echo attributes on img tags or data-echo-background attributes on elements with background images, then loads them as the user scrolls. The library provides fine-grained control over when loading begins through offset options that let you specify how far above, below, left, or right of the viewport images should start loading. A throttle mechanism with debounce prevents performance degradation from continuous scroll events.
The tool suits projects where bandwidth matters or page load speed is critical, particularly sites with many images below the fold. It works in older browsers including Internet Explorer 8 and later. The micro-library approach—at 2KB—makes it suitable for projects that want lazy-loading without the overhead of larger frameworks. Echo is appropriate for straightforward image-loading scenarios where you control the HTML and can add data attributes; it does not require build tooling or framework integration.
The project shows consistent maintenance with active issue response and pull request review. Development activity demonstrates attention to edge cases and performance, particularly around scroll event handling and the interaction between throttling and debounce modes. The codebase maintains backward compatibility while supporting granular offset configuration for different viewport edges, indicating careful consideration of real-world usage patterns.