verge
verge copied to clipboard
inViewport, inX, inY expressiveness
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?
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)
.
Sorry, that solution won't work, this needs some other fix.