how to add dragend event on svg element
d3.js, dom, javascript, svg
Solution
You seemed to be trying to do some kind of nested dragging or something, the following should work:
var drag1 = d3.behavior.drag()
.on("drag", dragmove)
.on("dragend", function () { alert("drag ended"); });
Full example: http://jsfiddle.net/xnjGD/
Problem
I am using D3.js to drag SVG elements, using concept of D3.js drag. drag is working fine but I want to call a function on dragend. How to do that? Here is jsFiddle Link. I simply want to call a function on dragend. Should I try ``` var drop = d3.behavior.drag() .on("dragend", function () { alert(); }); ```