在资源管理器中加载图标(svg)不起作用。

时间:2018-03-27 07:45:15

标签: svg

我在网站上使用了加载图标。这在Chrome等中运行良好,但在资源管理器中无法正常工作。 我的资源管理器版本是11.0。我在9版本之后搜索了该资源管理器支持svg文件。所以我不知道为什么。

<!DOCTYPE html>
<html>
<head> loading icon test
</head>
<body>
<div style="background:gray;">

<svg class="lds-spinner" width="200px"  height="200px"  
xmlns="http://www.w3.org/2000/svg" 
xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 100 100" 
preserveAspectRatio="xMidYMid" style="background: none;"><g 
transform="rotate(0 50 50)">
      <rect x="47" y="24" rx="9.4" ry="4.8" width="6" height="12" fill="#ffffff">
        <animate attributeName="opacity" values="1;0" times="0;1" dur="1s" begin="-0.9166666666666666s" repeatCount="indefinite"></animate>
      </rect>
    </g><g transform="rotate(30 50 50)">
      <rect x="47" y="24" rx="9.4" ry="4.8" width="6" height="12" fill="#ffffff">
        <animate attributeName="opacity" values="1;0" times="0;1" dur="1s" begin="-0.8333333333333334s" repeatCount="indefinite"></animate>
      </rect>
    </g><g transform="rotate(60 50 50)">
      <rect x="47" y="24" rx="9.4" ry="4.8" width="6" height="12" fill="#ffffff">
        <animate attributeName="opacity" values="1;0" times="0;1" dur="1s" begin="-0.75s" repeatCount="indefinite"></animate>
      </rect>
     </g><g transform="rotate(90 50 50)">
      <rect x="47" y="24" rx="9.4" ry="4.8" width="6" height="12" fill="#ffffff">
        <animate attributeName="opacity" values="1;0" times="0;1" dur="1s" begin="-0.6666666666666666s" repeatCount="indefinite"></animate>
      </rect>
     </g><g transform="rotate(120 50 50)">
      <rect x="47" y="24" rx="9.4" ry="4.8" width="6" height="12" fill="#ffffff">
        <animate attributeName="opacity" values="1;0" times="0;1" dur="1s" begin="-0.5833333333333334s" repeatCount="indefinite"></animate>
      </rect>
    </g><g transform="rotate(150 50 50)">
      <rect x="47" y="24" rx="9.4" ry="4.8" width="6" height="12" fill="#ffffff">
        <animate attributeName="opacity" values="1;0" times="0;1" dur="1s" begin="-0.5s" repeatCount="indefinite"></animate>
     </rect>
    </g><g transform="rotate(180 50 50)">
      <rect x="47" y="24" rx="9.4" ry="4.8" width="6" height="12" fill="#ffffff">
        <animate attributeName="opacity" values="1;0" times="0;1" dur="1s" begin="-0.4166666666666667s" repeatCount="indefinite"></animate>
      </rect>
    </g><g transform="rotate(210 50 50)">
      <rect x="47" y="24" rx="9.4" ry="4.8" width="6" height="12" fill="#ffffff">
        <animate attributeName="opacity" values="1;0" times="0;1" dur="1s" begin="-0.3333333333333333s" repeatCount="indefinite"></animate>
      </rect>
    </g><g transform="rotate(240 50 50)">
      <rect x="47" y="24" rx="9.4" ry="4.8" width="6" height="12" fill="#ffffff">
        <animate attributeName="opacity" values="1;0" times="0;1" dur="1s" begin="-0.25s" repeatCount="indefinite"></animate>
       </rect>
     </g><g transform="rotate(270 50 50)">
       <rect x="47" y="24" rx="9.4" ry="4.8" width="6" height="12" fill="#ffffff">
        <animate attributeName="opacity" values="1;0" times="0;1" dur="1s" begin="-0.16666666666666666s" repeatCount="indefinite"></animate>
      </rect>
    </g><g transform="rotate(300 50 50)">
      <rect x="47" y="24" rx="9.4" ry="4.8" width="6" height="12" fill="#ffffff">
         <animate attributeName="opacity" values="1;0" times="0;1" dur="1s" begin="-0.08333333333333333s" repeatCount="indefinite"></animate>
      </rect>
     </g><g transform="rotate(330 50 50)">
      <rect x="47" y="24" rx="9.4" ry="4.8" width="6" height="12" fill="#ffffff">
        <animate attributeName="opacity" values="1;0" times="0;1" dur="1s" begin="0s" repeatCount="indefinite"></animate>
      </rect>
    </g></svg>


</div>
</body>
</html>

1 个答案:

答案 0 :(得分:0)

Internet Explorer和Edge不支持SMIL动画(标记),如您在此页面上所示:
https://caniuse.com/#feat=svg-smil

如果您想保留现有代码,可以使用CSS动画或@ robert-longson说fakesmile