DEV Community

Discussion on: Lazy loading images with vanilla JavaScript

Collapse
 
tariqdevgit profile image
tariq-dev-git

Thank you for your article! :)
I found a little mistake:

.lazy {
display: none;
}

As the img element is not existing in the document it can not be reached with such display.
I suggest you to use instead:

.lazy {
visibility: hidden;
}