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
The 'appear' event and 'threshold' option - now there is not logic behaviour #301
Comments
And i found doc about 'appear' |
I am not sure if I understand your explanation, but the point of |
Here is the example of new code: |
It's only draft. But i think it will work. P.S. There is mistake in commit description:
|
And this commit too |
Other words, here all my commits for this feature: |
I began a testing and found the bug |
Everything done! :) |
Sorry but as I said the behaviour is now as expected. The |
Ok. I will send to you other patch now ;-) |
Hello!
Now if i use the threshold option, the 'appear' event occurs for image which is not only in viewport area - even for image which is in threshold area behind screen. So now there is the constant order of events for image: 'appear' -> 'load'
But i need and and i would like to suggest (i will make patch) a same behaviour:
I think that the right behaviour should be as: the 'appear' event should occur for image when it occurs in viewport area first time only, but the 'load' event should occur when image was loaded (in viewport or not if we use the 'threshold' option). So there may be same event orders: 'appear' -> 'load' and 'load' -> 'appear' and even only 'load' without 'appear' event. I think it will be logical behaviour. And a user will be able to attach handler to 'appear' event (how he can do through plugin settings) and will catch it only when image in viewport area.
What do you think about this?
If you will say that it's nice suggestion - i will make a patch for this. I don't think that this feature will break a some old code of other application based in lazyload plugin because the order of events is not described detailed in documentation now.
The text was updated successfully, but these errors were encountered: