任何人都可以发布如何为 svg 折线或路径设置动画的示例吗?
我想为从蓝线到灰线的过渡设置动画。理想情况下,我正在寻找一种解决方案,它可以在不知道其点坐标数的情况下解决任何灰线。
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title></title>
</head>
<body>
<div style="height: 200px; width: 500px; border: 1px solid #ccc;">
<svg height="200" width="500" xmlns="http://www.w3.org/2000/svg">
<polyline points="20,20 40,25 60,40 80,120 120,140 200,180"
style="fill: none; stroke: gray; stroke-width: 3" />
<polyline points="20,20 40,20 60,20 80,20 120,20 200,20"
style="fill: none; stroke: blue; stroke-width: 3" />
</svg>
</div>
</body>
</html>