我正在使用canvg()函数转换svg为canvas. 如果我们canvg()直接在 onload 上使用,它将全部转换svg为canvas. 我想转换svg与特定div的 .
html
<div id="notapply">
<svg><text x="50" y="50">Not to Apply!</text></svg>
</div>
<div id="apply">
<svg width="100" height="100">
<circle cx="50" cy="50" r="40" stroke="green" stroke-width="4" fill="yellow" />
</svg>
</div>
脚本
canvg();
在这里,它应该转换为svg与之相关div的id=apply.