2
寻找一些使用RaphaelJS拖放SVG的建议(示例很棒)。使用Raphael JS拖放SVGs
我已经找到了如何拖动对象创建withint拉斐尔
window.onload = function() {
var R = Raphael("canvas", 500, 500);
var c = R.circle(100, 100, 50).attr({
fill: "hsb(.8, 1, 1)",
stroke: "none",
opacity: .5
});
var start = function() {
...
},
move = function (dx, dy) {
...
},
up = function() {
...
};
c.drag(move, start, up);
};
但我需要能够适应这种用一个单独的SVG文件(S),所以例如 myPage.html下有MYIMAGE工作.svg,我需要能够将myImage.svg拖放到“画布”上。 我想这样
var c = R.SOMEMETHOD('myImage.svg');
...
c.drag(move, start, up);
例如。
有没有办法做到这一点,如果是这样,一个例子将是辉煌的!