Jump to content
GreenSock

KevinJ

Run through animation, pause then rerun animation.

Moderator Tag

Warning: Please note

This thread was started before GSAP 3 was released. Some information, especially the syntax, may be out of date for GSAP 3. Please see the GSAP 3 migration guide and release notes for more information about how to update the code to GSAP 3's syntax. 

Recommended Posts

Hi All,

 

I'm trying animate elements in an svg to fade in, once all the elements are visible, they will fade out after short delay and the animation will run again.

 

Should I use onComplete?

 

KJ

 

 

See the Pen EybYax by kjames (@kjames) on CodePen

Link to comment
Share on other sites

Thanks for the demo. Seems it was loading only TimelineMax and not TweenMax. No worries, I fixed it:)

 

Whenever you want the most control over a sequence I suggest a timeline over triggering things with onComplete.

 

From what you described, I would start with this:

 

var tl = new TimelineMax({repeat:-1, repeatDelay:0, delay:0.5})

tl.staggerTo(".hex", 0.5, {opacity:1}, 0.2)
  .staggerTo(".hex", 0.5, {opacity:0}, 0.2, "+=1"); //fade out after 1 second
  • Like 3
Link to comment
Share on other sites

Thanks Carl. Exactly what I was trying to do.

 

KJ

  • Like 1
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×