react-component / tween-one

Animate One React Element
https://tween-one.vercel.app/
MIT License
380 stars 30 forks source link

Is there any way to control when the animation begin on scroll? #31

Closed darrylsepeda closed 6 years ago

darrylsepeda commented 6 years ago

I found that the animation will start when the object is scrolled to the middle of the screen. I tried to use playScale and other API to make the animation start when the object reach the bottom of the screen but none of the API is working.

Is there any way to make the animation works when object reach the bottom of the screen??

jljsj33 commented 6 years ago
<OverPack playScale={0.1} style={{ minHeight: 500}}>
   <TweenOne key="tween" animation={{ y: 30, opacity: 0, type: 'from' }} >test</TweenOne>
</OverPack>

rc-scroll-anim, use min-height, OverPack box requires height.

darrylsepeda commented 6 years ago

thanks for the answer, actually I did in another way so I will close this issue.