Jump to content
GreenSock

TimelineMax

.getLabelAfter()

.getLabelAfter( time:Number ) : String

Returns the next label (if any) that occurs after the time parameter.

Parameters

time: Number

(default = NaN) — Time after which the label is searched for. If you do not pass a time in, the current time will be used.

 

Returns : String

Name of the label that is after the time passed to getLabelAfter()

 

Details

Returns the next label (if any) that occurs after the time parameter. It makes no difference if the timeline is reversed ("after" means later in the timeline's local time zone). A label that is positioned exactly at the same time as the time parameter will be ignored.

You could use getLabelAfter() in conjunction with tweenTo() to make the timeline tween to the next label like this:

myTimeline.tweenTo( myTimeline.getLabelAfter() );
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.
×