flickity icon indicating copy to clipboard operation
flickity copied to clipboard

Lazy load images

Open gerardkd opened this issue 11 years ago • 51 comments

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 ! :)

gerardkd avatar Jan 27 '15 16:01 gerardkd

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.

desandro avatar Jan 27 '15 16:01 desandro

:+1: obviously ;)

grayghostvisuals avatar Jan 27 '15 17:01 grayghostvisuals

+1

o-l-e avatar Jan 28 '15 09:01 o-l-e

:+1:

starise avatar Jan 28 '15 11:01 starise

+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

lunelson avatar Jan 29 '15 15:01 lunelson

+1

virgo79 avatar Jan 29 '15 17:01 virgo79

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:

nvartolomei avatar Jan 29 '15 19:01 nvartolomei

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 activate event should be dispatched from Flickity core to load modules (to deal with this problem I had to overwrite Flickity.imagesLoaded method)
  • implement the progressive way 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 avatar Jan 29 '15 20:01 glafarge

@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.

desandro avatar Jan 30 '15 13:01 desandro

+1

aguilera51284 avatar Feb 16 '15 22:02 aguilera51284

+1

ejfox avatar Feb 20 '15 16:02 ejfox

+1

chipcullen avatar Feb 27 '15 14:02 chipcullen

+1

zslabs avatar Feb 27 '15 16:02 zslabs

+1

jacmaes avatar Feb 28 '15 18:02 jacmaes

+1

zitrusfrisch avatar Mar 02 '15 14:03 zitrusfrisch

+1

FabianGabor avatar Mar 02 '15 17:03 FabianGabor

+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

piehouserat avatar Mar 02 '15 22:03 piehouserat

+1

ghost avatar Mar 05 '15 17:03 ghost

:+1:

ravanscafi avatar Mar 05 '15 20:03 ravanscafi

+1

DevJMD avatar Mar 06 '15 08:03 DevJMD