svgkendo-draggable

SVG kendodraggable


Does anyone here know how to make kendodraggable work on SVG?

I tried already but things just dont seem to work as I expected.

 $('#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) {
            }
     });

Thanks.


Solution

  • we can use transform attribute in svg and change its position.

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

    where tx,ty are your newXpos and newYpos