From 6fe8f703663084d742f59b50c9cff005db0f00f8 Mon Sep 17 00:00:00 2001 From: Dominic Masters Date: Fri, 8 Jun 2018 08:39:17 +1000 Subject: [PATCH] Added onVisible event --- public/animation/fade/ElementScrollFader.jsx | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/public/animation/fade/ElementScrollFader.jsx b/public/animation/fade/ElementScrollFader.jsx index 6e9615c..de60d3a 100644 --- a/public/animation/fade/ElementScrollFader.jsx +++ b/public/animation/fade/ElementScrollFader.jsx @@ -42,6 +42,10 @@ class ElementScrollFader extends React.Component { if(rect.top > window.innerHeight / 2) return; this.setState({visible: true}); this.detachListener();//stop Listening + + if(this.props.onVisible) { + this.props.onVisible(this.refs.fader); + } } componentWillUnmount() {