on-*-complete-*

Attach behaviour to the moment an animation finishes. The class names a handler registered via registerComplete (or a window function), optionally pointing at another animation instead.

Syntax

on-spawn-complete-<fn>fn(el) when a spawn finishes
on-loop-complete-<fn>each cycle of a loop / its completion
on-click-complete-<fn>when a click animation finishes
…complete-anim-<name>plays animation `<name>` once instead of calling fn
complete-time-Nduration override for the triggered anim
complete-delay-Ndelay override for the triggered anim
html
<div class="appear spawn-fade time-1 on-spawn-complete-docsPing">…</div>
<div class="appear spawn-up on-spawn-complete-anim-shake complete-time-1">…</div>

Live demo

Both boxes register their completion through the shared docsPing handler. Re-mount them and watch the stamps.

on-spawn-complete-docsPing
waiting…
timeline + complete hook
waiting…

Infinite loops can never "complete", so loop handlers fire on onRepeat - every cycle - while finite animations use their real onComplete.