0

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.

confused
  • 179
  • 12

1 Answers1

1

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

Nazik
  • 8,696
  • 27
  • 77
  • 123
deepthi
  • 20
  • 1
  • 3