小编fab*_*cio的帖子

无法使用ie9和firefox制作SVG动画

我不知道我错过了什么.SVG动画在chrome中显示确定,但是虽然我在ie9和firefox中看到了图像,但我看不到动画.

我从Corel Draw x5导出了svg文件:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN"        "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<!-- Creator: CorelDRAW -->
<svg xmlns="http://www.w3.org/2000/svg" xml:space="preserve" width="100%" height="100%" style="shape-rendering:geometricPrecision; text-rendering:geometricPrecision; image-rendering:optimizeQuality; fill-rule:evenodd; clip-rule:evenodd"
viewBox="0 0 25.4 2.64582"
 xmlns:xlink="http://www.w3.org/1999/xlink">
 <defs>
  <style type="text/css">
   <![CDATA[
    .str0 {stroke:#898989;stroke-width:0.05}
    .fil0 {fill:none}
   ]]>
  </style>
 </defs>
 <g id="Capa_x0020_1">
    <path class="fil0 str0" d="M0.10261 2.04656c0.08134,0 0.25217...
    />
Run Code Online (Sandbox Code Playgroud)

然后我添加了动画:

<path class="fil0 str0" d="M0.10261 2.04656c0.08134,0 0.25217...
    stroke-dasharray="">
  <animate id="first" attributeName="stroke-dashoffset" from="" to="0" dur="10s" begin="0s"
  onload="var length = parentNode.getTotalLength();
                   parentNode.setAttribute('stroke-dasharray',length+','+length);
                   this.setAttribute('from',length)" />
  </path>
Run Code Online (Sandbox Code Playgroud)

代码可以在jsfiddle http://jsfiddle.net/calamar888/WsxHs/中看到

非常感谢! …

firefox internet-explorer svg svg-animate

1
推荐指数
1
解决办法
2421
查看次数

标签 统计

firefox ×1

internet-explorer ×1

svg ×1

svg-animate ×1