ApoorvSaxena / ApoorvSaxena/lozad.js

Picture Element Lazy Loading

Abierto
#144 11 comentarios 10 reacciones 0 asignados Ver en GitHub
Lenguaje dominante
JavaScript
Estrellas
7.5k
Forks
435
Métricas de merge de PR
Sin PR fusionados en 30 d

Descripción

Firstly, thanks fo creating this amazing tool. I use it on almost every website I build. I would, however, like to open a discussion about the way that picture elements are lazy-loaded.

Why not just put the class `lozad` on the picture element and add then, when it enters the viewport, change all data-srcset attributes to srcset attributes on the source elements and on the img element, do the same but also change data-src elements to src elements.

The markup would then just become

```


```

Adding the `data-iesrc` attributes to the picture elements etc just seems confusing to me and I'm not sure what benefit it brings.

I would be very happy to submit a PR if this is something you are interested in?

Guía de contribución

Abrir la guía de contribución

Evaluación

Este issue todavía no se ha evaluado.

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.