Raphael.js 2.0.0 在 IE8 中拖放图像不起作用(vml)
我正在使用 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
它已修复,只需获取 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