Snap.parse(svg)

解析SVG片段字符串为SVG片段。


参数

svg 字符串。SVG字符串。


返回值

片段。元素片段。


使用
<svg id="svg" width="100" height="100"></svg>
var fragment = Snap.parse('<circle cx="50" cy="50" r="40"></circle>');
Snap("#svg").add(fragment);