question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Cards with lazy loading images

See original GitHub issue

Description

If an element is appended that includes an img with the loading="lazy" attribute. All cards will fail to be laid out. Optimally these elements should be appended and positioned as if they did not have the image (optionally with the width and height applied ahead of time), then re-positioned when the image loads at a later point.

Steps to check or reproduce

This can be reproduced using any grid with images:

  1. Navigate to https://codepen.io/pen/?&editable=true=https%3A%2F%2Fnaver.github.io%2Fegjs-infinitegrid%2Fassets%2Fhtml%2Fgrid.html
  2. In the JS section, change (line 1)
var template = '<div class="item"><div class="thumbnail"><img src="${link}../../assets/image/${no}.jpg"></div><div class="info">${text}</div></div>';

to (adding loading="lazy")

var template = '<div class="item"><div class="thumbnail"><img loading="lazy" src="${link}../../assets/image/${no}.jpg"></div><div class="info">${text}</div></div>';

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:8 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
daybrushcommented, Dec 4, 2020

@cloewen8

@egjs/infinitegrid 3.7.0 is released. Try it.

0reactions
cloewen8commented, Dec 6, 2020

Works great!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Lazy Loading Images – The Complete Guide - ImageKit.io
Lazy loading images that are not in the viewport improves initial page load performance and user experience. This is an in-depth guide to ......
Read more >
How to lazy load a Bootstrap 4 card's image? - Stack Overflow
The Question. In Bootstrap 4.2 how can I lazy load images for a card that will render the appropriate height and width of...
Read more >
WordPress homepage cards with lazy load images
WordPress homepage cards with lazy load images · Lazy loaded images · Look and feel of the design · Post navigation · Recent...
Read more >
Lazy load images - Oracle Help Center
Lazy loading of images helps pages to provide more content by recognizing which images will be presented to the shopper, and loading them...
Read more >
Lazy loading images - web.dev
In this post you will find out how to lazy-load both types of image. Inline images #. The most common lazy loading candidates...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found