Mechanical Events
jCanvas allows you to run a callback when you perform a layer-related action, such as adding a new layer or removing an existing layer. These events are referred to in jCanvas terminology as mechanical events, though they work like any other jCanvas event.
The add
event
The add
event fires when a layer is added (but before it is drawn).
The remove
event
The remove
event fires when a layer is removed using the removeLayer()
method (or indirectly via removeLayers()
or removeLayerGroup()
).
The change
event
The change
event fires when a layer’s properties are changed using the setLayer()
method (or indirectly via setLayers()
or setLayerGroup()
).
The move
event
The move
event fires when a layer is moved to a new position using the moveLayer()
method (or indirectly via moveLayers()
or moveLayerGroup()
).
Animation events
jCanvas provides the following events pertaining to animation: animatestart
, animate
, and animateend
.
jCanvas also supports a stop
event, which fires when the animation is stopped using the stoplayer()
method (or indirectly via stopLayerGroup()
).
Similarly, jCanvas supports a delay
event, which fires when the delayLayer()
method is called (or indirectly via delayLayerGroup()
).