Closed raglannyc closed 8 years ago
Hmm, the examples on the project's website seem to be working without the scroll option set: http://tylerdeitz.co/lazy-progressive-enhancement/ (every image besides the bottom ones)
I'm at work right now but I'll check out your example real quick! If I find a bug I'll get to it soon 👍
The only images I see on that page are the bottom ones :)
I'm in El Capitan 10.11.6 and Safari 10.0.
He he, the code to load the images runs after pressing the corresponding "Run" buttons. Is that working for you?
ahh oops, yeah those load for me after pressing "Run", but none of those are responsive images!
Ok, I'm able to recreate this bug & will check it out sometime tonight probably. I haven't looked too deeply into it but I'm feeling like the viewport parameters to load a responsive image aren't being set properly. Thanks a ton for reporting 😄
awesome, let me know if I can help
This has been fixed in https://github.com/tvler/lazy-progressive-enhancement/commit/95b32618af8d37c2ab75e9b955e01965421f6e33 !!
I'm now calling document.importNode
before appendChild
, as specified by https://developer.mozilla.org/en-US/docs/Web/API/Node/appendChild
If you want to append node from a different document the document.importNode() method must be used.
In Safari, when scroll is set to false, lazy loaded responsive images have a height of 0 and as such do not display. I set up a minimal example here: http://raglan.nyc/lazyload/
The dog image uses srcset, the cat is a plain ol' img.
Is there some difference in the way lazy loading is being done on scroll versus simply when the function is called?