react-gsap-enhancer icon indicating copy to clipboard operation
react-gsap-enhancer copied to clipboard

Not run the animation when the page is loading

Open davinanaya opened this issue 7 years ago • 1 comments

Hello,

Actually, i added the animation to a variable but when the page is loading the animation is run but i just want to run the animation in future handler not when the page is loading. Is that possible ?

This is working but i do not want to the animation run immediately. componentDidMount(){ window.animCircleNext = this.addAnimation(createAnim2Test) }

Regards.

davinanaya avatar Apr 23 '17 16:04 davinanaya

You may want to put a .pause() in your createAnim2Test tween and then in componentDidMount do something like:

componentDidMount(){
  var animCircleNext = this.addAnimation(createAnim2Test);
  // Do whatever you need to before animation plays...
  animCircleNext.play()
}

dbryand avatar May 04 '17 16:05 dbryand