Lazy load images
Cool plugin so far! Testing it now in a prototype for one of our clients.
Lazy Load 'slides' would be a killer feature if you ask me. Also for performance. Are there any plans to implement this?
Good luck in getting to the v1.0 release ! :)
Thanks for this feature request. I imagine others would like this as well. If you would like to see this feature implemented, please +1 this issue.
I'll have to figure out a nice way to implement it. There's a complication in that Flickity needs to know the width of the cells to properly slide to them, but unloaded images have no width. So cells would either need pre-defined widths, or have widths set for unloaded images.
Related: Lazy Flexslider for WordPress by @grayghostvisuals, and Slick has a lazy load option.
:+1: obviously ;)
+1
:+1:
+1.
Regarding the width limitation: is it enough if a width is specified in the CSS? And in absence of this width or an inline width on img or div just assume 100%? It seems to me this is a manageable obligation—certainly no more painful than the way images are lazy-loaded elsewhere, e.g. needing to know the aspect ratio of the image to be loaded in order to make vertical space for it etc
+1
And how about when you flick 3-5 slides away? It loses all it's beauty :(
Idea: first load some low quality images, and after flicking load the one needed to be displayed right now.
Idea 2: allow Flickity to be extended with plugins :shipit:
This is my very first approach to add this functionality: glafarge/flickity-lazyload
TODO :
- compute the number of visible items in container to load them accordingly
- i think an
activateevent should be dispatched from Flickity core to load modules (to deal with this problem I had to overwriteFlickity.imagesLoadedmethod) - implement the
progressiveway to load images as on slick.js - FIX the buggy behavior when previous button is pulled (loading previous images causes offset problems)
What do you think about it ?
@glafarge Thanks for taking a shot at this. Lazy loading is a complex feature. Right now I'm focusing on delivering the core feature set for Flickity. I'll look back at lazy loading once v1.0.0 is released.
+1
+1
+1
+1
+1
+1
+1
+1
I've implemented my own lazy loading using flickity and ajax but there's a bit of a jerk when it appends the next set of cells to the gallery. The code isn't great but I just wanted to get something up asap.
http://lucidprocess.com/life
Feedback would be extremely welcome
+1
:+1:
+1