当放大和缩小,或者在标签之间移动时,Chrome浏览器会破坏圆形div的动画。
检查此动画,例如:
http://jsfiddle.net/ghuhfya5/4/
body {
background-color: orange;
}
.child {
position: absolute;
animation: ripple 6s 0.5s ease-out infinite;
background-color: #FFF;
opacity: 0.9;
width: 2px;
height: 2px;
border-radius: 1px;
left: 50%;
top: 50%;
}
@keyframes ripple {
0% {
transform: scale(1);
opacity: 0.9;
}
80%, 100% {
transform: scale(500);
opacity: 0;
}在chrome中,放大和缩小(Ctrl +/-)会将圆变成矩形/正方形。
此外,尝试使用F5刷新,在刷新期间移动到另一个选项卡并等待2-3秒,然后返回到jsfiddle选项卡。它通常也会破坏动画(有时很难重现)。
还有更多的场景会导致动画被破坏。
在Firefox中,一切都运行得很好。在Firefox中尝试这些场景,您将看到动画效果与预期一致。
发布于 2015-10-12 17:09:36
找到了解决方法:
div的初始大小应大于2px和1 px边界半径。
它解决了大多数问题,如放大和缩小。
http://jsfiddle.net/ghuhfya5/17/
body {
background-color: orange;
}
.child {
position: absolute;
animation: ripple 6s 0.5s ease-out infinite;
background-color: #FFF;
opacity: 0;
width: 80px;
height: 80px;
border-radius: 40px;
left: 50%;
top: 50%;
}
@keyframes ripple {
0% {
transform: scale(0.0025);
opacity: 0.9;
}
80%, 100% {
transform: scale(12.5);
opacity: 0;
}https://stackoverflow.com/questions/32764489
复制相似问题