2014-06-22 229 views
0

SVG动画在Chrome中正常工作,但在Firefox中无法正常工作。 我想在页面加载后0.4秒开始动画。这是密码SVG动画在Chrome中正常工作但在Firefox中不能正常工作

<svg width="300px" height="300px" version="1.1" baseProfile="full" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:ev="http://www.w3.org/2001/xml-events"> 
<circle cx="150" cy="150" r="70"> 
     <animate dur="2s" attributeName="r" begin=".4" restart="whenNotActive" calcMode="spline" values="0; 100; 70; 50; 70; 95; 70; 60; 70; 75; 70; 68; 70" keySplines="0 .75 .5 1; .5 0 1 .25; 0 .25 .25 1; .5 0 1 .5; 0 0 1 1; 0 0 1 1; 0 0 1 1; 0 0 1 1; 0 0 1 1; 0 0 1 1; 0 0 1 1; 0 0 1 1" keyTimes="0; 0.2564; 0.5128; 0.6154; 0.6923; 0.7436; 0.7949; 0.8462; 0.8974; 0.9231; 0.9487; 0.9744; 1" fill="freeze"></animate> 
    </circle> 
</svg> 

我在做什么错?

+0

请说明到底发生了什么错,“不正常”是不是为读者非常有帮助。 –

+0

它不是在Firefox中动画。 – matuag

+0

问题是与开始=“。4”在这里检查http://jsfiddle.net/aTY4y/ –

回答

1

你的语法开始是错误的。尝试0.4s而不是.4,它会起作用。语法是here,Firefox可以精确地实现它。我建议你在Chrome上提交一个错误,它工作不正确。

这里是你的测试用例纠正......

<svg width="300px" height="300px" version="1.1" baseProfile="full" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:ev="http://www.w3.org/2001/xml-events"> 
<circle cx="150" cy="150" r="70"> 
     <animate dur="2s" attributeName="r" begin="0.4s" restart="whenNotActive" calcMode="spline" values="0; 100; 70; 50; 70; 95; 70; 60; 70; 75; 70; 68; 70" keySplines="0 .75 .5 1; .5 0 1 .25; 0 .25 .25 1; .5 0 1 .5; 0 0 1 1; 0 0 1 1; 0 0 1 1; 0 0 1 1; 0 0 1 1; 0 0 1 1; 0 0 1 1; 0 0 1 1" keyTimes="0; 0.2564; 0.5128; 0.6154; 0.6923; 0.7436; 0.7949; 0.8462; 0.8974; 0.9231; 0.9487; 0.9744; 1" fill="freeze"></animate> 
    </circle> 
</svg> 
+0

这解决了我的问题,纯粹是我的错。谢谢你,谢谢你的帮助:) – matuag

相关问题