拖动子节点时如何拖动父/复合节点
就我而言,复合节点内有一些子节点,我想让子节点不能单独移动,并且希望在拖动节点时移动整个组件。 在我的示例中,一切都按我的预期正常工作,例如拖动父节点会移动整个组件,但拖动子节点不会移动父节点和子节点。
Gone throw the following links for my related question.
Grab compound nodes when a child node is grabbed
Improved compound lock/grab/drag behaviour cytoscape
How to lock the position of a cytoscape.js node within its parent node
将样式属性events:no
设置为子节点,删除子节点的拖动事件并按我的预期工作,但它删除子节点中的所有事件。但我需要将选项卡事件发送到我的子节点。只是我想禁用子节点中的拖动事件以使其正常工作。
How to remove/disable drag event to the child node and only allow to parent node or any other option to resolve my problem?
最佳答案
如果您希望事件失败(即冒泡而不在目标本身上发射),那么您实际上无法有选择地对更高级别的手势执行此操作。
当 child 被拖动时,您只需沿着所有 sibling 移动即可实现您想要的行为。视觉效果是一样的。
关于javascript - 抓取子节点时抓取复合节点 cytoscape.js,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40032325/