大部分問題來自可拖動對象初始狀態莖:假
這是我的解決方案,到目前爲止,希望它帶給你更接近:http://jsfiddle.net/EwrkQ/4/
darthVaderImg.on('mouseover', function() {
document.body.style.cursor = 'move';
});
darthVaderImg.on('mousedown', function() {
this.moveTo(temp);
this.setDraggable(true);
this.simulate('dragstart');
layer.draw();
temp.draw();
});
darthVaderImg.on('dragmove', function() {
temp.draw();
});
darthVaderImg.on("dragend",function(){
//this.setDraggable(false);
this.moveTo(layer);
layer.draw();
temp.draw();
this.off("mouseup");
});
darthVaderImg.on('mouseout', function() {
document.body.style.cursor = 'default';
});
你看到小提琴嗎?我已經做到了... – jure 2013-03-06 23:02:06
EliteOctagon,你能幫我嗎?謝謝 – jure 2013-03-07 00:41:33