Raphael.js 2.0.0 在 IE8 中拖放图像不起作用(vml)

发布于 2024-12-01 12:05:32 字数 1220 浏览 3 评论 0原文

我正在使用 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);

谢谢!

I am using the rapahel version 2.0.0 and for some reason the image is
not being dragged in IE8(start and move get fired but the image is not
moving)there is no exceptions nor errors...
and I tried using the 1.5.2 it works but than I dont have the
onDragOver and snapTo methods and I need this 2 methods!!!

Does any one have the same problem and a solution to this???

here is the code:

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);

Thank you!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

酒与心事 2024-12-08 12:05:32

它已修复,只需获取 raphael.js v2beta 的新副本...Dmitry 更新了它!
https://github.com/DmitryBaranovskiy/raphael/tree/2.0

It's fixed, just get a new copy of the raphael.js v2beta...Dmitry updated it!
https://github.com/DmitryBaranovskiy/raphael/tree/2.0

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文