Jump to content
GreenSock

Timeline

.nextLabel()

.nextLabel( time:Number ) : String

Returns the next label in the timeline from the provided time. If no <code>time</code> is provided, the timeline's current playhead time will be used.

Powered by Froala Editor

Parameters

time: Number

The time to get the next label from.

Returns : String

Name of the label that is after the time passed to nextLabel(). If no time is provided, the timeline's current playhead time will be used.

Details

Returns the next label (if any) that occurs after the time parameter. If no time is provided, the timeline's current playhead time will be used. 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 nextLabel() in conjunction with tweenTo() to make the timeline tween to the next label like this:

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