Jump to content
Search Community

get Duration of current TimelineSet

dazzafact test
Moderator Tag

Go to solution Solved by GreenSock,

Recommended Posts

Hello There!,
Is it possible to get the current Time in Seconds of all timelines already set?
 

$tl.fromTo($slide,{alpha:0},{alpha:1,duration:1},0)
.to($slide,{duration:3},'>')
.to($slide,{alpha:0,duration:1},'>');

$time=$tl.currentTime()//1+3+1=4
alert($time)//4

 

Link to comment
Share on other sites

1 minute ago, GreenSock said:

Sure. 

$time = $tl.duration(); // without the timeline's repeats
$time = $tl.totalDuration(); // with the timeline's repeats (if any)

Loving your GSAP Plugin! one of my top 10 Javascript Libraries 💛💛💛

  • Like 2
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...