0

这里有谁知道如何在 SVG 上进行 kendodraggable 工作?

我已经尝试过了,但事情似乎并没有像我预期的那样工作。

 $('#image').kendoDraggable({
            hint: function (element) {
               return element.clone();
            },
            dragstart: function (e) {
               $(e.target.parentElement).append(e.target);
            },
            drag: function (e) {
                e.target.setAttribute('x', newXPOS);
                e.target.setAttribute('y', newYPOS);
            },
            dragend: function (e) {
            },
            dragcancel: function (e) {
            }
     });

谢谢。

4

1 回答 1

1

我们可以在 svg 中使用 transform 属性并改变它的位置。

transform=translate(tx,ty) or matrix(1,0,0,1,tx,ty) 

其中 tx,ty 是你的 newXpos 和 newYpos

于 2016-06-16T04:59:00.060 回答