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

Consider adding lazyLoad support #16

Closed
anderssonola opened this issue Nov 22, 2013 · 4 comments
Closed

Consider adding lazyLoad support #16

anderssonola opened this issue Nov 22, 2013 · 4 comments
Labels

Comments

@anderssonola
Copy link
Contributor

Hi @nathanaeljones,

How's your standpoint on adding lazyload support to slimmage?

Basic requirements:

  • Triggered on DOMContentLoaded and fallback to onload for legacy IE
  • Only load images that are visible in viewport
  • Load the non-visible images on scroll or window resize
@lilith
Copy link
Member

lilith commented Nov 26, 2013

If you mean postpone, per the Resource Priorities definition, it already does - you just add 'postpone' to the <img> tag.

I need to find the Google Chrome interview video - but basically anything happening on a mobile device shouldn't use 'postpone' behavior. Nearly all battery drain is from turning the radio on/off, so having all page requests happen at once is a good thing (tm) for battery life.

@anderssonola
Copy link
Contributor Author

Yeah I saw the 'postpone', but the support is more than limited at the moment.

My thought was to incorporate the concepts from https://github.com/tuupola/jquery_lazyload and only insert the image-ref to src-attribute when the image is "in" the viewport

@lilith
Copy link
Member

lilith commented Mar 4, 2014

Slimmage can't achieve its goals if it gets too bloated, and I think that lazy loading has been proven to be counterproductive in most scenarios.

I would be interested in seeing slimmage work alongside a separate lazyload module or jquery plugin. I don't see any reason that shouldn't be possible. By definition, conventional lazy loading breaks accessibility and forfeits graceful degradation, so there's no need to rely on Slimmage's abilities in that area. Just call checkResponsiveImages() after lazy loading occurs to 'responsify' images that have been hidden.

@lilith lilith added the question label Mar 4, 2014
@anderssonola
Copy link
Contributor Author

Thanks for the answer @nathanaeljones. You can close the question

@lilith lilith closed this as completed Oct 20, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants