0

I have a certain behavior in a d3 visualization that occurs on mouseover. It's a force layout, with elements that can be clicked and dragged. Right now if I mouseover one element while dragging another, the mouseover behavior is triggered. I want to suppress that while dragging. How can I make the behavior on one event conditional on the status of another event?

The code right now looks something like:

selection
  .call(force.drag) // allows you to drag and drop elements of the force layout
  .on("mouseover", function() {
    // behavior I want to suppress during click and drag
  })
  .on("mouseout", function() {
    // return layout to pre-mouseover state
  });
4

1 回答 1

0

显然问题与强制布局的这种行为有关:拖动强制布局会阻止其他 mouseup 侦听器

于 2013-07-08T03:09:31.137 回答