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

inview.js outofbound check #1881

Closed
oliverfoster opened this issue Nov 27, 2017 · 0 comments · Fixed by #1882
Closed

inview.js outofbound check #1881

oliverfoster opened this issue Nov 27, 2017 · 0 comments · Fixed by #1882
Assignees

Comments

@oliverfoster
Copy link
Member

oliverfoster commented Nov 27, 2017

At the moment this doesn't quite work as something can be out of bounds but at the edge of the bounding rectangle.
This code:

            var isOutOfBounds = (childOffsetTop > parent.clientHeight
                || childOffsetLeft > parent.clientWidth 
                || childOffsetBottom < 0
                || childOffsetRight < 0);

should be inclusive of edge:

            var isOutOfBounds = (childOffsetTop >= parent.clientHeight
                || childOffsetLeft >= parent.clientWidth 
                || childOffsetBottom <= 0
                || childOffsetRight <= 0);
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.

1 participant