HTML5 Canvas Event Delegation with KineticJS

To get the event target with KineticJS, we can access the targetNode property of the Event object.  This is particularly useful when using event delegation, in which we can bind an event handler to a parent node, and listen to events that occur on its children.

Instructions: Click on the star and observe that the layer event binding correctly identifies the shape that was clicked on.

Open in new window

Code Editor

Modified on April 9th, 2013 by Eric Rowell
comments powered by Disqus