Share Posted August 17, 2015 Hi, I am having a little problem dragging an anchor, look at the CodePen please. An additional problem is that the SVG can be dragged clicking not only in the SVG but (specially at the left) when i am clicking far away from the SVG (100 pixesla i guess). All is in the Codepen. Again, excuse if maybe some of this questions are very basic. Please advice, any help are welcome See the Pen NqVvQX by Cormack (@Cormack) on CodePen Link to comment Share on other sites More sharing options...
Share Posted August 17, 2015 Hi cormack if i understood correctly , you should to set svg width/height + correct position for svg child elements See the Pen yNWzVZ by MAW (@MAW) on CodePen 3 Link to comment Share on other sites More sharing options...
Share Posted August 17, 2015 I like to put outlines around elements while positioning them, which will let you clearly see the problem. To drag an anchor, first you need to set 'dragClickables: true' on your draggable. But an anchor is an inline element, so you need to wrap it in something like a div or set it to display block in you CSS. See the Pen eNaGga by osublake (@osublake) on CodePen 3 Link to comment Share on other sites More sharing options...
Author Share Posted August 18, 2015 Great!! Thanks OSUblake and Diaco @Diaco, what i don't understand (because i don't know much or anything about SVG) is how do you calculate correctly the height and the witdth and the correct calculation of the childs. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now