Jump to content
GreenSock

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

Timeline

.totalProgress()

.totalProgress( value:Number, suppressEvents:Boolean ) : *

[override] Gets or sets the timeline's total progress which is a value between 0 and 1 indicating the position of the virtual playhead (including repeats) where 0 is at the beginning, 0.5 is at the halfway point, and 1 is at the end (complete).

Parameters

value: Number

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

suppressEvents: Boolean

(default = true) — If true, no events or callbacks will be triggered when the playhead moves to the new position.

Returns : *

Omitting the parameter returns the current value (getter), whereas defining the parameter sets the value (setter) and returns the instance itself for easier chaining.

Details

Gets or sets the timeline’s total progress which is a value between 0 and 1 indicating the position of the virtual playhead (including repeats) where 0 is at the beginning, 0.5 is at the halfway point, and 1 is at the end (complete). If the timeline has a non-zero repeat defined, progress() and totalProgress() will be different because progress() doesn’t include the repeat or repeatDelay whereas totalProgress() does.

For example, if a timeline instance is set to repeat once, at the end of the first cycle totalProgress() would only be 0.5 whereas progress would be 1. If you watched both properties over the course of the entire animation, you’d see progress go from 0 to 1 twice (once for each cycle) in the same time it takes the totalProgress() to go from 0 to 1 once.

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, like myAnimation.totalProgress(0.5).play();

  1. var progress = myAnimation.totalProgress(); //gets total progress
  2. myAnimation.totalProgress(0.25); //sets total progress to one quarter finished
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.
×