HTML5 Canvas Canvas Multi-Event Binding Tutorial
To bind multiple events to a single handler with Konva, we can use the on()
method and pass in a space delimited string containing multiple event types.
shape.on('mouseover mousedown mouseup', function (e) {
console.log('events: ' + e.type);
});
Instructions: Mouseover, mousedown, and mouseup over the circle to observe that the function bound to the circle is executed for each event.
- Vanilla
- React
- Vue