Css 在两个不同的时间对同一动画进行排队,而不重复代码并给出新名称?
我有两个动画Css 在两个不同的时间对同一动画进行排队,而不重复代码并给出新名称?,css,css-animations,Css,Css Animations,我有两个动画bounce和squishstretch 我想先做squishstretch动画,然后bounce,然后再做squishstretch 这不起作用: animation-name: squishstretch, bounce, squishstretch; animation-duration: .15s, .2s, .12s; animation-delay: 0, .25s, .55s; animation-iteration-count: 2, 2, 2; 但这是真的 ani
bounce
和squishstretch
我想先做squishstretch
动画,然后bounce
,然后再做squishstretch
这不起作用:
animation-name: squishstretch, bounce, squishstretch;
animation-duration: .15s, .2s, .12s;
animation-delay: 0, .25s, .55s;
animation-iteration-count: 2, 2, 2;
但这是真的
animation-name: squishstretch, bounce, squishstretch2;
animation-duration: .15s, .2s, .12s;
animation-delay: 0, .25s, .55s;
animation-iteration-count: 2, 2, 2;
但这意味着我必须复制出所有的squishstretch
规则(供应商在前面加了不少前缀),并给副本起一个新名称
有没有一种方法可以修复它,而不必复制大量规则,以便动画名称可以具有唯一的名称
演示:制作一个动画
@keyframes squishstretchbounce {
0% { height: 100px; width: 100px; margin-left: 0; bottom:0; }
44% { height: 94px; width: 104px; margin-left: -2px; bottom: -6px;}
88% { height: 100px; width: 100px; margin-left: 0; bottom:0; }
89% { bottom: 0; }
95% { bottom: 10px; }
100% { bottom: 0; }
}
然后使用动画:squishstretchbounce 1.4s无限代码>。我编译的关键帧比你编译的关键帧多的原因是为了使其动画恢复到默认状态。还要确保添加浏览器前缀。另一方面,我认为未固定的关键帧
需要是@关键帧
制作一个动画
@keyframes squishstretchbounce {
0% { height: 100px; width: 100px; margin-left: 0; bottom:0; }
44% { height: 94px; width: 104px; margin-left: -2px; bottom: -6px;}
88% { height: 100px; width: 100px; margin-left: 0; bottom:0; }
89% { bottom: 0; }
95% { bottom: 10px; }
100% { bottom: 0; }
}
然后使用动画:squishstretchbounce 1.4s无限代码>。我编译的关键帧比你编译的关键帧多的原因是为了使其动画恢复到默认状态。还要确保添加浏览器前缀。另一方面,我认为未固定的关键帧
需要是@关键帧