Make scrolling other elements trigger lazy-loading#62
Make scrolling other elements trigger lazy-loading#62zaccharles wants to merge 1 commit intocallmecavs:masterfrom
Conversation
8e9d4ed to
063dc4b
Compare
|
@zaccharles I like the idea. I think for a cleaner implementation though, it might make more sense to extend the current I'll look into this in the near future, when I get some time to potentially cut a release. I also want to do some testing, to make sure the existing in viewport calculation will work for elements that are inside scrolling containers, rather than a scrolling |
|
I think that sounds like a better solution. As for the in viewport calculation, I can tell you that it worked on my app, so at least there's some promise :) I also exposed requestFrame in my fork and found it quite useful to have access the that. Anyway, I'll continue using my fork for now, happy to help if I can, though I think you're all over it :) |
|
cheers man 🍻 hopefully I'll get a chance to take a look this weekend - if not definitely next week. glad to hear that this is working in your fork, praying I wont have to rework anything haha |
|
Hello @callmecavs and @zaccharles @zaccharles are you planning to resolve conflicts? Or in another way I can create new pull request for the same feature with my code and tests. What do you think about it? |
|
Happy for you to create a new PR @ilyaztsv :) |
|
@zaccharles I created PR regarding to optional container with scroll. |
This PR fixes a problem I currently have. Simply, I have a div on my page which is
overflow: auto. Inside this div, I have a bunch of images that I want to lazy-load with Layzr. The issue is that Layzr'shandlersmethod only operates onwindow. This means that only scrolling the window itself will trigger lazy-loading, and scrolling any other element won't. I propose the addition ofhandlersForwhich will add thescrollhandler for the given node.Note: I looked into detecting resizing of a div (though, it's not a problem I have). It seems that this is a popular solution, and very efficient. However, it would introduce a dependency for an edge case which is probably rare. Having said that, maybe we should expose
requestFrame(perhaps under a different name) as a hook for adding other triggers?