Hacker News new | ask | show | jobs
by alexza 2380 days ago
Some browsers like chrome support this functionality natively by setting the image attribute loading="lazy" (https://web.dev/native-lazy-loading/) You could improve your library by adding a check wether the browser supports it natively, if yes use the loading attribute, if no use the visibility observer
1 comments

Thanks for that note! The check is added and the script uses the native lazy load if supported :D