Jump to content
GreenSock

Search In
  • More options...
Find results that contain...
Find results in...
felipexavier

How i use TimelineMax to sequence animations?

Recommended Posts

I have the image of a painting and on this painting will appear 3 color images. I showed them. The problem is who are appearing at the same time and it can not happen. can anybody help me?

 

code:

var tl = new TimelineMax({delay:1, repeat:-1});
tl.from(color1, 2, {left: 200, opacity:0, repeat:-1}).from(color2, 2, {left: 200, opacity:0, repeat:-1}).from(color3, 2, {left: 200, opacity:0, repeat:-1});


sorry for the horrible English

Link to comment
Share on other sites

hi and welcome to the GreenSock forums.

 

since the first tween has repeat:-1 it will never end and thus the next tween will never start.

 

try this

 

var tl = new TimelineMax({delay:1, repeat:-1});
tl.from(color1, 2, {left: 200, opacity:0, repeat:-1})

.from(color2, 2, {left: 200, opacity:0, repeat:-1}, 2) //start at 2 seconds

.from(color3, 2, {left: 200, opacity:0, repeat:-1}, 4); //start at 4 seconds
  • Like 2
Link to comment
Share on other sites

thank you!!!

 

I removed the

repeat: -1

in the animation

from(tinta1, 2, {left: 200, opacity:0});

ai worked as I wanted, but I have one more doubt, as I would for color appears without effect fade ?

Link to comment
Share on other sites

Sorry, I can't understand your last questions.

 

Please create small demo here: http://codepen.io/GreenSock/pen/KzMVoz

 

Hit the "FORK" button, add your code and save. 

Send us the link to see.

 

thanks

  • 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.
×