Svg - javascript | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 6

Svg - javascript

how can I creat a SVG with the coordinates of 2 other SVG which the user can move ? example : the user move SVG-1<rect> to: x=0 y=0 (width=50 height=50) and move the SVG-2 <rect> to: x=10 y=50 (width=50 height=50) and then creat a third SVG-3 (unvisible) with coordinates: x1=0 (x of SVG-1) y1=0 (y of SVG-1) x2=60 (x+50 of SVG-2) y2=100 (y+50 of SVG-2) and of course when the user move of the 2 SVG <rect> the coordinates of SVG-3 will actualise (sorry for my bad english...) thanks

30th Sep 2017, 4:00 PM
NoxFly
NoxFly - avatar
6 Answers
+ 4
I've already creat the twice svg draggable but idk how to creat the third
30th Sep 2017, 4:23 PM
NoxFly
NoxFly - avatar
30th Sep 2017, 4:41 PM
NoxFly
NoxFly - avatar
+ 3
but my code need animation and in sololearn it doesn't work, so I don't have this code on SL... I will creat a code just with this 2 elements
30th Sep 2017, 4:34 PM
NoxFly
NoxFly - avatar
+ 3
I havent could. Im interesting because in other way I think we must to use canvas
30th Sep 2017, 4:35 PM
Daniel
Daniel - avatar
+ 3
you have Xa and Ya the left up corner of bloc-1. You have Xb and Yb the right down corner of bloc-2. I want a new <rect> with the coordinates Xa,Ya;Xb,Yb.
30th Sep 2017, 4:50 PM
NoxFly
NoxFly - avatar
+ 3
with a draw I can shiw you easily, have you discord ?
30th Sep 2017, 4:53 PM
NoxFly
NoxFly - avatar