jquery.lazy
jquery.lazy copied to clipboard
Any chance to support Intersection Observer?
Will you plan to implement Intersection Observer into this plugin?
Maybe, yes. :wink: I will leave this open here as improvement.
@eisbehr - I'll be happy to donate/sponsor this update to make this possible ;)
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?
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
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.