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

Only detecting when elements are above or below viewport #70

Closed
alexlafroscia opened this issue Jun 24, 2016 · 1 comment · Fixed by #127
Closed

Only detecting when elements are above or below viewport #70

alexlafroscia opened this issue Jun 24, 2016 · 1 comment · Fixed by #127

Comments

@alexlafroscia
Copy link

alexlafroscia commented Jun 24, 2016

Is there some way to configure this to only detect when the element is above or below the viewport? I don't care if it went off the page sideways and only want to check if it scrolled off the top.

I was able to achieve the effect by setting viewportTolerance.left and viewportTolerance.right to a really large, arbitrary number, but a way to disable the left-right check altogether would be even better since I figure there are some computations that could then be avoided.

@tomdale
Copy link

tomdale commented Dec 21, 2016

Could you just use Infinity as the value? I suspect doing an integer comparison is actually faster than having two different code paths from treating it as a separate case.

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

Successfully merging a pull request may close this issue.

2 participants