Problem
The original line path element naturally appears before the cloned element.
This causes problems for other plugins that perhaps have added event listeners (mouseover, mouseout, etc) to the original element as these events will not be triggered by the cloned element, for a couple of reasons:
cloneNode does not clone events of the original element, and
the cloned element appears 'over' the original element, effectively blocking triggering of events.
Solutions
One solution is to clone the events of the original node.
However, since the cloned node is purely presentational, perhaps it would be better to either disable mouse / pointer events of the cloned node or simply insert it first before the original node.
Problem The original line path element naturally appears before the cloned element.
This causes problems for other plugins that perhaps have added event listeners (mouseover, mouseout, etc) to the original element as these events will not be triggered by the cloned element, for a couple of reasons:
cloneNode
does not clone events of the original element, andSolutions One solution is to clone the events of the original node.
However, since the cloned node is purely presentational, perhaps it would be better to either disable mouse / pointer events of the cloned node or simply insert it first before the original node.