Nice article!
We could implement some lazy-loading by putting the large image as the background of an element that appears only when we hover the thumbnail.
Here's an example that demonstrate how lazy-loading would work:
<style> img:hover + .big { background-image: url('https://via.placeholder.com/300x300'); width: 300px; height: 300px; } </style> <img src="https://via.placeholder.com/100x100"> <div class="big"></div>
Inspecting the network requests, we can see that the large image is just fetched when we hover the thumbnail.
Of course, we'd have to work a little harder with accessibility.
Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment's permalink.
Hide child comments as well
Confirm
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Nice article!
We could implement some lazy-loading by putting the large image as the background of an element that appears only when we hover the thumbnail.
Here's an example that demonstrate how lazy-loading would work:
Inspecting the network requests, we can see that the large image is just fetched when we hover the thumbnail.
Of course, we'd have to work a little harder with accessibility.