Jump to content
Search Community

TimelineLite negative delay ?

Reemak
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

Posted

Hello,

I have a timelinelite with 4 tweens appended to it, and i would like to make the second one start like 0.5 s before first one ends etc.

How can i do that please ?

 

I tried setting a negative delay but it won't work...

 

var timingnumbers = 4;

 

var timelinenumbers = new TimelineLite();

timelinenumbers.append( TweenLite.fromTo($("#num01"), timingnumbers,{css:{left:-441}}, {css: {left:850}} ) );

timelinenumbers.append( TweenLite.fromTo($("#num02"), timingnumbers,{css:{left:854}}, {css: {left:-520}}, {delay:-0.5} ) );

timelinenumbers.append( TweenLite.fromTo($("#num03"), timingnumbers,{css:{left:-450}}, {css: {left:851}}, {delay:-0.5} ) );

timelinenumbers.append( TweenLite.fromTo($("#num04"), timingnumbers,{css:{left:852}}, {css: {left:-520}}, {delay:-0.5} ) );

Posted

I got, only the syntax was wrong :

 

timelinenumbers.append( TweenLite.fromTo($("#num02"), timingnumbers,{css:{left:854}}, {css: {left:-520}}, -0.5 ) );

 

 

works fine !

Posted

Yep, you're exactly right. And if you want to make your code even more concise, you can use the fromTo() convenience method of TimelineLite:

 

timelinenumbers.fromTo( $("#num02"), timingnumbers, {css:{left:854}}, {css: {left:-520}}, -0.5 );

 

(but there's nothing wrong with doing a regular append() - I just wanted to point out the convenience method in case it was helpful)

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