views:

290

answers:

1

Hi,

In my application I have a line drawn from one table cell to another cell through jQuery SVG plugin. Following the steps of the blog post http://www.openstudio.fr/Library-for-simple-drawing-with.html I managed to add it. But at the same time I need to remove that line and draw it on another place when mouse hovers. Is there a method to remove the drawn line or should I follow a different methodology to hide it or remove it ? Any help is highly appreciated.

A: 

According to the documentation the line function returns an svg <line> element, so you should be able to remove it using the standard DOM core method removeChild().

Untested, but hopefully working:

var myline = svg.line(parent, x1, y1, x2, y2, settings);
parent.removeChild(myline);
Erik Dahlström