News for hackers. Stuff that matters.
Re:Show HN: The smallest and most narcissistic image lazyloa... by alexza on Thursday December 19, 2019 @08:06AM (#21834531)
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
Re:Show HN: The smallest and most narcissistic image lazyloa... by l1am0 on Thursday December 19, 2019 @10:19AM (#21835573)
Thanks for that note! The check is added and the script uses the native lazy load if supported :D