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

inViewport, inX, inY expressiveness #28

Open
ryanve opened this issue Mar 15, 2017 · 2 comments
Open

inViewport, inX, inY expressiveness #28

ryanve opened this issue Mar 15, 2017 · 2 comments

Comments

@ryanve
Copy link
Owner

ryanve commented Mar 15, 2017

In 1.x the signature for these is .inViewport(element, cushion=0) where cushion is an optional +/- cushion around the element. Is this clear enough or should we somehow redesign to be more expressive?

@drgullin
Copy link

Right and bottom cushion doesn't work for negative values.

https://github.com/ryanve/verge/blob/master/verge.js#L86-L87
If I set cushion -100, verge won't mark nodes as visible starting from 0 to 100 of the window height, but it also won't mark nodes as visible starting from (window height - 100), because 200 + -100 (200 is an example offset) equals to 100, not 300. - cushion should be replaced with (- Math.abs(cushion).

@drgullin
Copy link

Sorry, that solution won't work, this needs some other fix.

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

2 participants