Skip to content
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

Any chance to support Intersection Observer? #133

Open
melcak opened this issue Feb 24, 2018 · 5 comments
Open

Any chance to support Intersection Observer? #133

melcak opened this issue Feb 24, 2018 · 5 comments
Assignees

Comments

@melcak
Copy link

melcak commented Feb 24, 2018

Will you plan to implement Intersection Observer into this plugin?

@dkern
Copy link
Owner

dkern commented Feb 26, 2018

Maybe, yes. 😉
I will leave this open here as improvement.

@dkern dkern self-assigned this Feb 26, 2018
@wpexplorer
Copy link

@eisbehr - I'll be happy to donate/sponsor this update to make this possible ;)

@dkern
Copy link
Owner

dkern commented May 2, 2018

Well, I'm open for this! So lets talk about this ...

Only thing I have in mind, is that these observer is not available in any version of IE. So how should this be done? Polyfill? Fallback? Ignore?

@dkern
Copy link
Owner

dkern commented Jun 4, 2018

Hello @melcak and @wpexplorer

I gave this a try and implemented a first approach into Lazy. It seems to work well and still supports all features of the original plugin. Only downside is the drop of support for IE and Safari. For this browser you will need to use a polyfill.

Maybe you want to test this too. I'm open for any feedback. The file is located in the IO Test Branch:
https://github.com/eisbehr-/jquery.lazy/blob/intersection-observer/jquery.lazy.js

@jklegseth
Copy link

Nice! I'm all in favor of IO, I've found the performance and UI are both better, but not a fan of the polyfill (the provided polyfill has 79 open issues, hasn't been updated since October 2018, and is 21.8 KB unminified). Maybe consider using feature detection to load a different file, like lazyload does. For those who want to polyfill they still can.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants