alt attribute on lazy-loaded <picture> tags
See original GitHub issueFor the sake of accessibility, it would be cleaner if lazy-loaded images using <picture>
tags could “inherit” their alt
attribute from a data-X attribute on picture tag.
On our project we easily managed that by overloading the load
function of lozad (and using data-lazy-img-alt
attribute). It could be nice if it could be default (a11y is important).
There can be two ways :
- make this functionnality by default
- write a documentation paragraph explaining how to overload the
load
function.
Attempting to do a pull-request in this direction, I was confronted to the problem of test coverage (see #93)
Issue Analytics
- State:
- Created 6 years ago
- Comments:6 (3 by maintainers)
Top Results From Across the Web
Missing alt tag for lazy-loading images - WordPress.org
Hello, I'm using the image lazy loading feature, which automatically replaces images with an img that has a data string as the src....
Read more >Alt tag for src='blank.gif' on lazy load images | SEO Forum - Moz
I am loading 20 images that are in the viewport and a bit below. The next 80 images I want to ... Alt...
Read more >How to hide image's alt tag when you reload the page with ...
I am using lazyload to display my images in my website (with data-src instead of src). However, when you reload the page, you...
Read more >Browser-level image lazy loading for the web - web.dev
This post covers the loading attribute and how it can be used to control the loading of images.
Read more >Lazy Loading Images – The Complete Guide - ImageKit.io
Which Images can be Lazy Loaded? Lazy Loading Techniques for images. The general concept of lazy loading images in <img> tag; Trigger image...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@robots4life : I should have said
override
instead ofoverload
😃Basically, you can easily customize the behavior of lozad, and use your own loading function (code from documentation) :
What we have done in our project : we made our own loading function, based on the default one of lozad :
feature has been released in v1.5.0 of Lozad and added in README as well, thanks everyone for their contributions on this thread