Question

Is it possible to do the drag and drop from stage1 to stage2 ? stage1 would be containing the draggable shapes, and stage2 would be the target.

Était-ce utile?

La solution

Yes, you can, with something like this:

image.on('dragmove', function() {
    if ((!stage.getPointerPosition()) && image.getParent() !== layer2) {

      image.stopDrag();

      image.moveTo(layer2);
      image.position(stage2.getPointerPosition());
      image.startDrag();
      layer.draw();
      layer2.draw();      
    }
})

DEMO

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top