私はrapahelバージョン2.0.0を使用していますが、何らかの理由で画像がIE8でドラッグされていません(開始して移動すると起動しますが、画像は移動しません)例外もエラーもありません...そして1.5を使用してみました. 2 動作しますが、onDragOver メソッドと snapTo メソッドがなく、この 2 つのメソッドが必要です!!!
誰も同じ問題とこれに対する解決策を持っていますか???
コードは次のとおりです。
var start = function () {
this.onDragOver(function(event){
this.animate({"x":Raphael.snapTo(this.attr("x"), event.attr("x")
+3, 1), "y":Raphael.snapTo(this.attr("y"), event.attr("y")+3, 1)},
100);
if(event.data("bin") == 1){this.animate({"opacity": 0.1}, 1000,
function(){this.remove();});}
});
this.ox = this.type == "rect" || this.type == "image" ?
this.attr("x") : this.attr("cx");
this.oy = this.type == "rect" || this.type == "image" ?
this.attr("y") : this.attr("cy");
this.attr({cursor: "move"});
this.toFront();
};
var move = function (dx, dy) {
this.attr(this.type=="rect" || this.type == "image" ?{x: this.ox +
dx, y: this.oy + dy}:{cx: this.ox + dx, cy: this.oy + dy});
};
var end = function () {
//this.animate({"fill-opacity": 1}, 500);
};
var width = 800, height = 450;
var paper = Raphael("canvas", width, height);
var lbl1 = paper.image("img/label.png", 10, 40, 100, 22);
lbl1.drag(move, start, end);
ありがとうございました!