check out onmousedown and onmouseup to have a little more control.

A click is a full completion of both of these events (mouse down, then mouse up). I think you're looking for the mouse down even.


From this example, you can add if (d3.event.defaultPrevented) return; into your click event to prevent it from happening when a zoom is happening.

  if (d3.event.defaultPrevented) return;

Here is an implementation, from your fiddle.

Related Query