Open wenjoy opened 3 years ago
There are a few events you could subscripe to.
Begin and End events, you could then detect if your element is outside viewport.
Events.scrollEvent.register('begin', function(to, element) {
console.log('begin', arguments);
});
Events.scrollEvent.register('end', function(to, element) {
console.log('end', arguments);
});
As I tested, this event only trigger when use scroll
method of react-scroll
not the scroll of browser. If I understand wrongly, please correct me.
What I want to do is notify me when element was scrolled (by mouse or trackpad) out viewport.
Would also like to know. The documentation is vague and the examples not complete.
Per title, I want to do some extra work when the
Element
is out of viewport. And I don't needLink
to display on the screen, so the Link'sonSetActive
will not help.