-
Notifications
You must be signed in to change notification settings - Fork 158
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
Unable to manually trigger the check on lazyloaded elements #71
Comments
For example Echo.js expose such API: https://github.com/toddmotto/echo#render |
I think adding a class should trigger a DOM mutation event right? But here you are adding a class on the container and we only check for mutation changes on images themselves (https://github.com/vvo/in-viewport/blob/f2ccb3db0565dbc9c4ae4e596c2f6405ed8f1ead/in-viewport.js#L240) Yes the best way would be to expose the checkAll from in-viewport https://github.com/vvo/in-viewport/blob/f2ccb3db0565dbc9c4ae4e596c2f6405ed8f1ead/in-viewport.js#L236 in the in-viewport returned object. Then from the lazyload returned register method, attach checkAll Line 19 in a0889aa
We could name it Thanks for the awesome bug report :) |
Thanks for your answer but I do know how to "attach checkAll" (I see for the exposition of checkAll in the in-viewport lib). So I will not be able to make a PR for this issue. |
So I dug into this issue and find that you already fixed it in in-viewport with the following commit vvo/in-viewport@49d9f24 (btw your code comment says 200ms but the code says 150ms :)), which is available since v3.2.0. The problem is in fact that the lazyload build you provide (https://github.com/vvo/lazyload/tree/master/build) is based on in-viewport@3.1.0. So could you update the build available on lazyload master (it seems that when you tag a new version you do not update build directory and bower.json file) ? Thanks. |
Ah yes I could do that, I think I will provide an option to disable it and do the manual check exposure also. Because setInterval might be too slow in some usecases. |
Hi, |
Hello
Use case: I have a grid of lazyloaded images (hundreds of images) and on the top of the page some features to filter these images.
The issue is: when I use my filter features, some images under the fold are supposed to be loaded as some of above the fold images are excluded (=hidden). But there are not, I need to scroll or resize the screen for them to be loaded.
Indeed it seems that your in-viewport library "only" listens to scroll, resize and DOM mutation events. None of them are triggered in my case.
There seems to be no public method to call to force the debouncedCheck call (it would not be a problem for me to trigger the call manually in my own code, as my use case is quite specific).
Here are some screenshots to show the issue :
First display of the page:
Then we click on the button:
I have to scroll down for the right images to appear:
I put this demo online : http://ratibus.net/vvo_lazyload/
Thanks in advance :)
The text was updated successfully, but these errors were encountered: