Open gajus opened 8 years ago
In relation to https://github.com/dinbror/blazy/issues/103
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?
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
Adds two configurations:
checkHorizontalElementVisibility
(defaults totrue
) – toggles check of horizontal element visibility check.checkVerticalElementVisibility
(defaults totrue
) – toggles check of vertical element visibility check.The primary use case
setInterval
), such as the carousel.Example use case
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).