1 个仓库
Logic that chooses the most appropriate asset URL based on device attributes and browser capabilities.
Distinct from HTML Data Attribute Extraction: Distinct from HTML Data Attribute Extraction: focuses on using extracted attributes to make a selection decision rather than just extracting the data.
Explore 1 awesome GitHub repository matching web development · Source Selection Logic. Refine with filters or upvote what's useful.
layzr.js 是一个 JavaScript 图像懒加载库,旨在通过延迟图像下载直到其进入浏览器视口来提高初始页面加载速度。它作为一个响应式图像选择器,根据浏览器支持和设备像素比识别最合适的图像源。 该库采用响应式图像交付系统,评估数据属性以选择最佳源。它包含一个动态内容跟踪机制,监控文档中新添加的图像,以确保它们自动添加到加载队列中。 该项目通过 Intersection Observer API 提供可见性跟踪,并包含一个强制手动视口刷新的实用工具。它还具有一个事件发射器,允许在图像源更新前后通过生命周期钩子执行自定义逻辑。
Implements a system to select the optimal image URL by evaluating custom HTML attributes against device pixel ratios.