IE 11 中的简单 CSS3 动画不是 运行
Simple CSS3 animation not running in IE 11
我有一个基本的圆形加载器动画示例,它不会在 IE 11 中启动,但几乎所有其他浏览器都能流畅运行
代码:
.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;
}
}
<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 中只是一个点
我在类似的问题上发现了这个 (Source):
Only Microsoft Edge will support SVG CSS Transitions and Animation.. especially stroke-dasharray.
Please see the Microsoft Developer Docs:
https://dev.windows.com/en-us/microsoft-edge/platform/status/csstransitionsanimationsforsvgelements
在 Edge 中测试,仅在设置单位时有效:
0% {
stroke-dasharray: 1, 200;
stroke-dashoffset: 0px; /* px required */
}
我有一个基本的圆形加载器动画示例,它不会在 IE 11 中启动,但几乎所有其他浏览器都能流畅运行
代码:
.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;
}
}
<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 中只是一个点
我在类似的问题上发现了这个 (Source):
Only Microsoft Edge will support SVG CSS Transitions and Animation.. especially stroke-dasharray.
Please see the Microsoft Developer Docs: https://dev.windows.com/en-us/microsoft-edge/platform/status/csstransitionsanimationsforsvgelements
在 Edge 中测试,仅在设置单位时有效:
0% {
stroke-dasharray: 1, 200;
stroke-dashoffset: 0px; /* px required */
}