
Show HN: Gandul – accessible image lazy loading - alterebro
https://github.com/alterebro/accessible-image-lazy-load
======
fake-name
Or maybe, and this might sound crazy, just USE THE FUCKING IMAGE TAG.

Seriously, websites where the images are broken without javascript are FUCKING
ANNOYING.

There are image formats that support progressive rendering. Use those if
you're that desperate, but STOP BREAKING THE FUCKING INTERNET FOR NO GOOD
REASON.

~~~
antibland
Native lazy-loading[0] is coming in Chrome 75.

<img src="celebration.jpg" loading="lazy" alt="..." />

[0] [https://addyosmani.com/blog/lazy-
loading/](https://addyosmani.com/blog/lazy-loading/)

~~~
tyingq
With some caveats, like _" An implementation detail of loading in Chrome is
that it fetches the first 2KB of images on page-load."_.

That's the first 2KB of every image.

~~~
Traubenfuchs
So on the server side I will have lots of errors/exceptions because only 2kb
were loaded of each image?

~~~
tyingq
I assume it does a range request. I was more pointing out that the client will
still make a lot of requests. So maybe still not a good approach for long
pages with tons of images below the fold.

------
lpghatguy
Rendering an anchor in the place of an image in case I don't have JavaScript
enabled doesn't feel very good.

I'd much rather have image solutions that fail gracefully if the JS on my page
is broken or the user just has it disabled.

~~~
duhi88
Why not? I think it is a fair replacement for a lot of image use-cases. If JS
is turned off, users still have the ability to view the image and description,
without the image hurting your total page weight.

------
revskill
How about lazily turn <a> into <img> without hurting performance ? It's useful
if the network is slow.

------
zichy
I don't get why this is supposed to be particular accessible. <img> is
perfectly fine, the alt attribute should describe the contents for users with
screen readers and crawlers.

------
kingkool68
I really dig this approach. Pretty clever.

------
JorgeGT
Nice name!

