SVG タグを使用してロールオーバーをアニメーション化しようとして<set>
いますが、dur="1s" を指定してもトランジションは瞬時です (Firefox、Safari、Opera、および Chrome)。
<html>
<body>
<svg xmlns="http://www.w3.org/2000/svg" version="1.1">
<circle cx="100" cy="50" r="40" stroke="black" stroke-width="2" fill="red">
<set attributeType="CSS" attributeName="fill" to="green" begin="mouseover" end="mouseout" dur="1s" />
</circle>
</svg>
</body>
</html>
2 つのタグを使用して必要な効果を実現<animate>
できますが、保存したい初期色が異なる可能性がある複数の要素にトランジションを適用できるようにしたいと考えています (この方法では、最初の色「赤」を2 番目のアニメーション タグ)。
<html>
<body>
<svg xmlns="http://www.w3.org/2000/svg" version="1.1">
<circle cx="100" cy="50" r="40" stroke="black" stroke-width="2" fill="red">
<animate attributeType="CSS" attributeName="fill" to="green" begin="mouseover" dur="1s" fill="freeze" />
<animate attributeType="CSS" attributeName="fill" to="red" begin="mouseout" dur="1s" fill="freeze"/>
</circle>
</svg>
</body>
</html>
最初のコード セグメントの<set>
タグは初期の色を保持しますが、トランジションはアニメーション化されません。私の w3 仕様の理解が正しければ、それは正しいはずです - これはブラウザ固有のバグのように見えますか、それとも w3 仕様を誤解していましたか? これについてもっと良い方法はありますか?