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

Negative tolerance seems wrong #50

Open
howardcox opened this issue Apr 10, 2019 · 0 comments
Open

Negative tolerance seems wrong #50

howardcox opened this issue Apr 10, 2019 · 0 comments

Comments

@howardcox
Copy link

howardcox commented Apr 10, 2019

Hi,

I think there's a bug when using negative tolerance.

if I put an element squarely in the centre of the screen and call:

$(#test).is(':in-viewport(-100)');

It will return false.

This is because the bottom is less than the settings.tolerance (which is set to the viewport height minus the offset).

isVisibleFlag = settings.tolerance ? top <= settings.tolerance && bottom >= settings.tolerance : bottom > 0 && top <= $viewportHeight

I believe that this should be bottom <= settings.tolerance.

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

No branches or pull requests

1 participant