sv en en en en en en en en en en en en en en en fa en en fr hbs_lat en en en es en en en de en en fr en en ca en en en en en en ca en en en pl pl sv en en en it uk ky en en ru ru az de de fa de mn uk az en en en it ar tg ru en es tr it en mr ru el ceb fa tr ko en en ar tr hbs_lat de en en fi fa ru de myv fi ru da fr eu ja en da fr en kn en en en en hi en en en en en en en en en ca en en en en en en en en en en en en en en en es en es en en en en en en en fr cv es tr es en en en en ms en en en en en en fr en hbs_lat en en en en en en en fr cv es tr es en en en en de en en en ca en en en en en
Gets or sets the position of the playhead according to the totalDuration which includes any repeats and repeatDelays.
(default = NaN) — Omitting the parameter returns the current value (getter), whereas defining the parameter sets the value (setter) and returns the instance itself for easier chaining. Negative values will be interpreted from the END of the animation.
(default = false) — If true, no events or callbacks will be triggered when the playhead moves to the new position defined in the time parameter.
This method serves as both a getter and setter. Omitting the parameter returns the current value (getter), whereas defining the parameter sets the value (setter) and returns the instance itself for easier chaining.
totalTime will never exceed the totalDuration, nor will it be less than 0 (values will be clipped appropriately). Negative values will be interpreted from the END of the animation. For example, -2 would be 2 seconds before the end. If the animation’s totalDuration is 6 and you do myAnimation.totalTime(-2), it will jump to a totalTime of 4.
var tt = myAnimation.totalTime(); //gets total time
myAnimation.totalTime(2); //sets total time, jumping to new value just like seek().
Copyright 2017, GreenSock. All rights reserved. This work is subject to theterms of useor for Club GreenSock members, the software agreement that was issued with the membership.
“No other animation library is as intuitive, rigorous, conceptually simple and well curated as GreenSock’s”
“The GreenSock animation platform is one of the most useful sets of tools in existence when it comes to web animation.”
“Aside from GreenSock’s laser-focused attention to detail, GSAP is fast, reliable, flexible, exceptional value (read: free in most cases) and, very importantly, supported.”
“...obviously GSAP is incredible”
“If every library were as robust and reliable as GreenSock’s, the world would be a much better place for software engineers and their clients. I can't think of a better designed or better performing tool, and as a bonus, it's fun as heck to play with.”
“I am more and more amazed every day, and very glad that I decided to get a business license.”
“Really quite impressed with @GreenSock JS - even the small things.”
“With the incredible functionality, and the mind-blowing customer service, the price of Club GreenSock admission is well worth it!”
“I’ve long felt like GSAP is the best kept secret in JavaScript.”
Sign Up For Our Newsletter
Get the latest updates on GreenSock products, exclusive offers, and more right in your inbox.
Your information will always be kept confidential.
Thanks for signing up!
Now you'll begin receiving the latest GreenSock updates, exclusive offers, and more right in your inbox. Welcome aboard.