Events

Events:

SVG Events:

Full scale DOM event types are supported along with some additional event behaviors like Drag, Zoom, etc.

Events

Event

SVG

Canvas

WebGL

click

Yes

Yes

Yes

dblclick

Yes

Yes

Yes

mousemove

Yes

Yes

Yes

mousedown

Yes

Yes

Yes

mouseup

Yes

Yes

Yes

mouseleave

Yes

Yes

Yes

contextmenu

Yes

Yes

Yes

touchstart

Yes

Yes

Yes

touchend

Yes

Yes

Yes

touchmove

Yes

Yes

Yes

touchcancel

Yes

Yes

Yes

Usage

#.on(eventType, eventHndlr)

To bind event handlers on the graphical element. Accepts eventType and event handler as an argument. The handler receives the event object as an argument.

element.on('click',function(event){ // if no data bound, then only event object.
    this; // this refers to the element context.
});

Last updated