-
-
Notifications
You must be signed in to change notification settings - Fork 676
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Image already loaded via LazyLoad.load()
still fires original callback_loaded
when image comes into view
#526
Comments
Hey @nick-vincent I’ll look into it first thing next week. |
Very well written issue by the way, thank you @nick-vincent! |
Well, the thing is that the So there is no way to tell the script "if the callback has been passed to the The strange thing here is that the main LazyLoad instance is triggering the "start image loading" again, instead of recognizing that the image has been already loaded by the So I would work to make sure the image loaded with the Would this resolution satisfy your needs? |
Closed with the release of 17.3.2. |
Hi @verlok! Sounds like the fix you landed on is correct: don't try to load an image that's already been loaded. 😬 Appreciate your detailed response, and thanks for addressing the issue so quickly! |
Hey @nick-vincent , If you’re happy with my support, the documentation and the effort I’ve been putting on this project in the latest years, I hope you might want to buy me a coffee to show your appreciation. Or sponsor me, if you're a fan. Open-source software is great for everyone, but it takes passion and time to grow and evolve. Thank you for thinking about it. Have a nice day and beginning of the upcoming week! |
Describe the bug
When an offscreen image is loaded early with
LazyLoad.load(img)
, the originalcallback_loaded
from theLazyLoad(settings)
constructor is not fired.(Perhaps this is the expected behavior, and you must pass in a new
callback_loaded
viaLazyLoad.load(img, settings)
?)However, if you do pass a new callback into
LazyLoad.load()
, the new callback is fired when the image loads, but the original callback (from the constructor) is still fired when you scroll to the element.To Reproduce
Expected behavior
LazyLoad.load()
, I would expect the original callback to fireLazyLoad.load()
, I would expect it to "overwrite" the original callback, and I would NOT expect the original callback to also fire later when the image scrolls into view.LazyLoad version
Desktop (please complete the following information):
The text was updated successfully, but these errors were encountered: