With KineticJS, is it possible, to bind the function only once? Like with the jQuery equivalent…
eg. in jQuery
// bad
$('.wrap a').on('click', myHandler);
// good
$('.wrap').on('click', 'a', myHandler);
I would like to do this with KineticJS as well, as there’s going to be a lot of objects.
This is Eric from KineticJS. Currently, you can use container.get() to get an array of nodes similar to jQuery, like these:
but you cannot yet bind events to all of the nodes via the selector like this:
layer.get(‘Rect’).on(‘click’, …);
I’ll add this to my todo list, so it should probably be released within a couple weeks 🙂
Cheers!
Eric