首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >IE 11中未运行的简单CSS3动画

IE 11中未运行的简单CSS3动画
EN

Stack Overflow用户
提问于 2016-12-15 19:36:30
回答 1查看 1.5K关注 0票数 2

我有一个基本的循环加载程序动画的例子,它不会在IE11中启动,但是运行平稳,几乎每一个其他浏览器都是如此。

代码:

代码语言:javascript
复制
.circular-still {
  height: 150px;
  -webkit-transform-origin: center center;
  transform-origin: center center;
  width: 150px;
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  right: 0;
  margin: auto;
}
.path {
  -webkit-animation: dash 1.5s ease-in-out infinite;
  animation: dash 1.5s ease-in-out infinite;
  stroke: #c0c0c0;
  stroke-linecap: round;
  stroke-dasharray: 89, 200;
  stroke-dashoffset: -124px;
}
@-webkit-keyframes dash {
  0% {
    stroke-dasharray: 1, 200;
    stroke-dashoffset: 0;
  }
  50% {
    stroke-dasharray: 89, 200;
    stroke-dashoffset: -35px;
  }
  100% {
    stroke-dasharray: 89, 200;
    stroke-dashoffset: -124px;
  }
}
@keyframes dash {
  0% {
    stroke-dasharray: 1, 200;
    stroke-dashoffset: 0;
  }
  50% {
    stroke-dasharray: 89, 200;
    stroke-dashoffset: -35px;
  }
  100% {
    stroke-dasharray: 89, 200;
    stroke-dashoffset: -124px;
  }
}
代码语言:javascript
复制
<div id="loader" style="display: block;">
  <svg class="circular-still" viewBox="25 25 50 50">
    <circle class="path" cx="50" cy="50" r="20" fill="none" stroke-width="4" stroke-miterlimit="5" />
  </svg>
</div>

下面是一个示例,如果在任何浏览器中打开,但IE 11,您应该得到一个动画圆圈,但在IE11中只有一个点。

https://jsfiddle.net/3orv8rjz/

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2016-12-16 14:56:37

我在一个类似的问题(Source)上发现了这个

只有Microsoft将支持SVG转换和动画。尤其是中风达沙雷。 请参阅Microsoft Developer Docs:https://dev.windows.com/en-us/microsoft-edge/platform/status/csstransitionsanimationsforsvgelements

在Edge中测试,只有在设置单元时,它才能工作:

代码语言:javascript
复制
0% {
    stroke-dasharray: 1, 200;
    stroke-dashoffset: 0px; /* px required */
}
票数 3
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/41172038

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档