dinbror / blazy

Hey, be lazy! bLazy.JS is a lightweight pure JavaScript script for lazy loading and multi-serving images. It's working in all modern browsers including IE7+.
http://dinbror.dk/blazy
MIT License
2.63k stars 356 forks source link

Make element visiblity check configurable #104

Open gajus opened 8 years ago

gajus commented 8 years ago

Adds two configurations:

Website contains a carousel element. Images in the carousel are using lazy loading. Carousel transitions (loading new content) are controlled using setInterval. In such case, simply adding scroll or re-indexing the images on the page upon click event is not enough – it would require running re-indexing multiple times. A simple solution is to disable horizontal visibility check (thus the hidden content in the carousel will be loaded as soon as carousel scrolls into the view).

gajus commented 8 years ago

In relation to https://github.com/dinbror/blazy/issues/103

dinbror commented 8 years ago

Hey @gajus

Sorry for the late reply. Thanks for the PR. Normally with carousels I'm using the public ´load´ function to load what slides into the view. Wouldn't that also solve your issue?

idoshamun commented 7 years ago

I find this PR very useful for my use cases as well. Sometimes I animate elements horizontal from outside the viewport to inside. I want the images to be loaded already when animating in