【发布时间】:2017-05-09 12:57:13
【问题描述】:
在 MS Edge 浏览器中,只要动画持续时间不同,简单的旋转动画就会变得非常粗糙。这是一个简单的例子:
#LogoRotator { z-index: 99; width: 40px; height: 40px; border-radius: 50%; border: 1px solid transparent; border-top-color: #3498db; animation: spin 2s linear infinite; }
#LogoRotator:before { content: ""; position: absolute; top: 2px; left: 2px; right: 2px; bottom: 2px; border-radius: 50%; border: 1px solid transparent; border-top-color: #e74c3c; }
#LogoRotator:after { content: ""; position: absolute; top: 5px; left: 5px; right: 5px; bottom: 5px; border-radius: 50%; border: 1px solid transparent; border-top-color: #f9c922; }
@keyframes spin { 100% { transform: rotate(360deg); } }
#LogoRotator.varySpeed:before { animation: spin 3s linear infinite; }
#LogoRotator.varySpeed:after { animation: spin 1.5s linear infinite; }
<p>With identical animation durations:</p>
<div id="LogoRotator"></div>
<p>With different animation durations:</p>
<div id="LogoRotator" class="varySpeed"></div>
如果你在 Edge 中查看这个 sn-p,你会发现当动画速度相同时,运动非常平滑,但只要持续时间改变,运动就会到处跳跃:
有没有办法在持续时间变化时使动画平滑?
【问题讨论】:
标签: css animation css-animations microsoft-edge