Search code examples
javascriptkineticjs

kineticJS " box.on('dragend', alert("drag end"))" doesn't fire at end of drag


I need need to trap the "dragend" event of a shape being dragged to update properties palette for that shape. I have tried the code below, but this function only fires when the shape is created and not at the end drag.

 box.on('dragend', alert("drag end"))

Solution

  • The Kinetic node.on method takes a function declaration as its second parameter.

    circle1.on("dragend",function(){alert("dragend")});