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

Add an option to use only vertical element position to determine its view-ability #103

Open
gajus opened this issue Jul 29, 2016 · 1 comment

Comments

@gajus
Copy link

gajus commented Jul 29, 2016

blazy/blazy.js

Lines 164 to 170 in b0cc033

function elementInView(ele) {
var rect = ele.getBoundingClientRect();
return (
// Intersection
rect.right >= _viewport.left && rect.bottom >= _viewport.top && rect.left <= _viewport.right && rect.top <= _viewport.bottom
);
}

The current implementation is checking whether element is in a viewport vertically and horizontally. There are cases (e.g. a carousel) when the intention is to load all elements that are in viewport vertically, disregarding horizontally.

@gajus
Copy link
Author

gajus commented Aug 1, 2016

@dinbror Would you like me to raise a PR for this feature?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants