When multiple animations need to be started, it is often
desirable to synchronise their start times.
'nextFrame' will start the animation on the
next animation frame. Starting several animations with nextFrame
will ensure they are all synchronized to that frame time.
Similarly 'prevFrame' starts the animation on the last animation
frame.
'syncNow' will start an animation at a synchronized 'now' time. The
first time 'syncNow' is used, the current time will be stored and used
for all subsequent calls to 'syncNow'. 'syncNow' is reset every
time a new animation frame is drawn.
Alternately, 'now' can be used which will use the current time as
the animation start time. As javascript is single threaded, using 'now
on multiple animations will result in them all having slightly different
start times.
Animation start time options.
TypeWhen | number | null
When multiple animations need to be started, it is often desirable to synchronise their start times.
'nextFrame'will start the animation on the next animation frame. Starting several animations withnextFramewill ensure they are all synchronized to that frame time.Similarly
'prevFrame'starts the animation on the last animation frame.'syncNow'will start an animation at a synchronized 'now' time. The first time 'syncNow' is used, the current time will be stored and used for all subsequent calls to 'syncNow'. 'syncNow' is reset every time a new animation frame is drawn.Alternately,
'now'can be used which will use the current time as the animation start time. As javascript is single threaded, using'nowon multiple animations will result in them all having slightly different start times.A custom time can be used if a
numberis defined.nullwill result in'nextFrame'being used