aFarkas / lazysizes

High performance and SEO friendly lazy loader for images (responsive and normal), iframes and more, that detects any visibility changes triggered through user interaction, CSS or JavaScript without configuration.
MIT License
17.56k stars 1.73k forks source link

Pausing Intersection effect when scrolling #967

Open anonimusprogramus opened 2 years ago

anonimusprogramus commented 2 years ago

A 500 images to be shown, with viewport only fit for 10 images.

A floating bar provides 5 anchor links, to scroll to image #1, #101, #201, #301 and (last) #401.

First time user visits, 10 images lazy loaded (for simplicity).

If user clicks last anchor link (to image 401), the container will scroll down and trigger lazy loading hundreds images.

Questions:

    • Can we have a variable state that can be set false before click and then set true after scrolling? ie. like lazySizes.cfg.paused = true/false
  1. If it's not possible, then how's to achieve that scrolling without lazy loading hundreds images but only 10 (as viewport needs)?

Thank you