Jump to content
Search Community

Using timeline as an animation target

azazdeaz test
Moderator Tag

Go to solution Solved by Diaco,

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,

 

Instead of .add() a timeline to the other, can i tween it? Like this:

tl.to(otherTl, 2, {time: 3, ease: Elastic.easeOut})
tl.to(otherTl, 2, {time: 3, ease: Elastic.easeOut})
tl.set(otherTl, {reversed: true})
tl.to(otherTl, 2, {progress: 0.2})

I tried in the codepen demo and it's working pretty well. (And this is unbelievably cool!  :) ) But i did'n find any mention or documentation for this. (Sorry if i just missed it)

Does it safe to do?

If it is, which properties can we animate or toggle?

See the Pen waXVgG?editors=001 by azazdeaz (@azazdeaz) on CodePen

Link to comment
Share on other sites

  • Solution

Hi azazdeaz  :)

 

as you can read in Doc :

A TweenLite instance handles tweening one or more properties of any object (or array of objects) over time.

 

you can tween these properties :

 

.time()

.totalTime()

.duration()

.totalDuration()

.progress()

.totalProgress()

.timeScale()

 

btw , you can use these method too :

 

.tweenTo()

.tweenFromTo()

  • Like 5
Link to comment
Share on other sites

Yup, being able to tween the time(), timeScale() and progress() can give you some great effects and a level of control that you would be hard-pressed to find in other engines.

 

Here are some demos:

 

http://codepen.io/GreenSock/pen/LuIJj

http://codepen.io/GreenSock/pen/zcmpo?editors=001

 

As Diaco mentioned, tweenTo and tweenFromTo will tween the time() of a TimelineMax and its pretty cool if you throw an ease in there too!

  • Like 4
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.
×
×
  • Create New...