我正在使用 RaphaelJS 和 FreeTransform-plugin。当我拖动一个元素时,我想做一些事情,但是当我使用以下代码时,freetransform-handles 处理我们的位置:
var paper = Raphael('floor');
var el = paper.image('http://blog.knibbdesign.com/wp-content/uploads/2011/11/NAlexander-Chair-Folding2.jpeg', 50, 50, 360, 360);
var ft = paper.freeTransform(el);
var start = function () {
this.ox = this.attr("x");
this.oy = this.attr("y");
},
move = function (dx, dy) {
this.attr({x: this.ox + dx, y: this.oy + dy});
console.log('Am i moving?');
},
up = function () {
};
el.drag(move, start, up);
如果我删除“el.drag()”,则手柄位于正确的位置。小提琴示例:http: //jsfiddle.net/4x73N/6/