Jump to content
GreenSock

TimelineMax

.totalDuration()

.totalDuration( value:Number ) : *

[override] Gets or sets the total duration of the timeline in seconds (or frames for frames-based timelines) including any repeats or repeatDelays.

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. Negative values will be interpreted from the END of the animation.

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 total duration of the timeline in seconds (or frames for frames-based timelines) including any repeats or repeatDelays. duration, by contrast, does NOT include repeats and repeatDelays. For example, if the timeline has a duration of 10, a repeat of 1 and a repeatDelay of 2, the totalDuration would be 22.

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.

var total = myTimeline.totalDuration(); //gets total duration
myTimeline.totalDuration(10); //sets the total duration
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.
×