我有两个SVG动画附加到一个路径元素。我想要鼠标经过,让Anim1触发,然后mouseout和Anim2触发,我希望这是可重复的。我使用的是begin=X.mouseover、begin=X.mouseleave和fill="freeze"。
它在第一次运行时效果很好;所以鼠标经过Anim1时会触发,鼠标离开时会触发Anim2。但它只会在鼠标悬停时触发Anim1,Anim2就再也不会触发了(至少我看不到它在做任何动画)。
动画是paths I'm animating attribute d。我尝试过Chrome和Opera,同样的结果。
<path class="js-sector-rollover" id="sector1" x="400" y="431" fill="#7a596a" stroke="#3a596a" d="REMOVED">
<animate id="animOut" attributeName="d" begin="sector1.mouseover" dur="1.2s"
from="REMOVED" calcMode="spline" keySplines="0.25 0.1 0.25 1"
keyTimes="0;1" fill="freeze" restart="whenNotActive"></animate>
<animate id="animIn" attributeName="d" begin="sector1.mouseout" dur="1.2s"
from="REMOVED" calcMode="spline" keySplines="0.25 0.1 0.25 1"
keyTimes="0;1" fill="freeze" restart="whenNotActive"></animate>
</path>我已经从代码块中删除了实际路径,以使其更易于阅读。
我也尝试过使用beginElement和endElement,也得到了同样的结果。
感谢您的关注..
发布于 2014-01-24 06:30:39
当另一个动画开始时,需要使用end属性来完成相反的动画。
https://stackoverflow.com/questions/21318419
复制相似问题