0
我有很多Raphael元件,其餘推入數組的:拖動()對raphael.js陣列元素
var start = function() {
this.ox = this.attr("cx");
this.oy = this.attr("cy");
},
move = function (dx, dy) {
this.attr({cx: this.ox + dx, cy: this.oy + dy});
}
for(var i = 0; i < 149; i++) {
cubes = paper.rect(Math.floor(Math.random()*2000), Math.floor(Math.random()*2000), 0, 0);
cubes.animate({ width: 25, height: 25 }, 500, "bounce");
cubesmixed.push(cubes);
cubesmixed[i].drag(move, start);
}
但不幸的是,我不能拖動它們。最奇怪的是,start
和move
因爲他們應該。但爲什麼他們不動。
在此先感謝!