Mouse Events
jCanvas supports a number of standard mouse events that you can use on most types of jCanvas layers. Supported events include click
, dblclick
, mousedown
, mousemove
, mouseup
, pointerdown
, pointermove
, pointerup
, and contextmenu
.
Events and animation
When you click the star in the demo below, it will spin.
Multiple layers with events
This example utilizes multiple layers with events attached.
When calling the animateLayer()
method, you should pass it the layer object to animate that particular layer. Failing to do so will animate the first layer by default.
The mouseover
and mouseout
events
The mouseover
and mouseout
can be used separately, or together.