Background load is not detected. Always calls the 'isLoaded' callback.
See original GitHub issueHello,
thanks for the great piece of the code of yours 💯
Though I found imagesloaded
, while in the background mode does not detect if the image is loaded. Either it is or it is not, or even when the element does not have any background, the callback function signals in all the cases that the bg is loaded.
Here is the reduced test case on CodePen based on your recommended example.
Can you please kindly check and fix this or tell if I do something wrong?
Thanks again, Val
Issue Analytics
- State:
- Created 6 years ago
- Reactions:1
- Comments:5 (1 by maintainers)
Top Results From Across the Web
How can I check if a background image is loaded?
I have a jQuery plugin called waitForImages that can detect when background images have downloaded. $( ...
Read more >Lazy Loading Images – The Complete Guide - ImageKit.io
An image, not visible to the user when the page loads, is loaded later ... Here is a working example that lazy loads...
Read more >Introduction: callbacks - The Modern JavaScript Tutorial
The onload event is described in the article Resource loading: onload and onerror, it basically executes a function after the script is loaded...
Read more >Detect when images have finished loading with React
componentDidMount() is called when your React component is rendered. ... In case it's not clear yet, render is always before load.
Read more >next/image - Next.js
Firefox 67+ displays a white background while loading. Possible solutions: ... A callback function that is invoked when the image is loaded.
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
Same problem here. Why is it still not being fixed? This plugin is completely useless - it runs my function even if the picture is not loaded (or also if there is no picture at all or the complete div does not exist).
I can confirm that this is not working for background images. It is triggering “done” long before the image actually loads. I am dynamically creating a number of DIVs and applying a “background-image” to each. If I use Chrome’s developer tools to set “Fast 3G”, there are a few seconds between “done” triggering and the images finishing to load/displaying.