toddmotto / echo

Lazy-loading images with data-* attributes

Home Page:http://toddmotto.com/labs/echo

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Throttle `_pollImages`

necolas opened this issue · comments

window.onscroll fires a lot during scrolling. There should really be some functiona call throttling, e.g., http://documentcloud.github.io/underscore/#throttle

Thanks Nicolas, I was just tweeting about this the other day:

https://twitter.com/toddmotto/status/405370085751005184

Throttling makes for much better perf. Also adding a feature that allows the user to add an offset (also in tweet), which will load images 'before' the viewport based on the offset, setting the lazy load off before the user gets there. :)

On 28 Nov 2013, at 18:33, Nicolas Gallagher notifications@github.com wrote:

window.onscroll fires a lot during scrolling. There should really be some functiona call throttling, e.g., http://documentcloud.github.io/underscore/#throttle


Reply to this email directly or view it on GitHub.

Integrated in latest update. Will push shortly.