是否可以使这两个CSS动画相互配合?

用户名

我在同一元素中有两个CSS动画,它们彼此冲突。我看过其他答案,说如果它们用逗号分隔,则可以分配多个动画,但是这些示例用于速记动画分配。是否有任何方法可以使这两个动画协同工作?:

.whiteLayer{
-webkit-transform: scale(0);
transform: scale(0);
margin-top: 50px;
border-radius: 50%;
width: 475px;
height: 475px;
border: 1px dashed white;
position: absolute;
top: 12px;
margin-left: 8px;
-webkit-animation-name: spin;
-webkit-animation-duration: 60s;
-webkit-animation-timing-function: linear;
-webkit-animation-iteration-count: infinite;
-webkit-animation-play-state: running;
-webkit-animation-delay: 2s;
animation-name: spin;
animation-duration: 60s;
animation-timing-function: linear;
animation-iteration-count: infinite;
animation-play-state: running;
animation-delay: 2s;


-webkit-animation-name: intro;
-webkit-animation-duration: .2s;
-webkit-animation-timing-function: linear;
-webkit-animation-delay: .2s;
-webkit-animation-fill-mode:forwards;
animation-name: intro;
animation-duration: .2s;
animation-timing-function: linear;
animation-delay: .2s;
animation-fill-mode:forwards;


}

@-webkit-keyframes spin {
from {transform: rotate(0deg);}
to {transform: rotate(360deg);}
}

@keyframes spin {
from {transform: rotate(0deg);}
to {transform: rotate(360deg);}
}

@-webkit-keyframes intro{
from {transform: scale(0);}
to {transform: scale(1);}
}

@keyframes intro {
from {transform: scale(0);}
to {transform: scale(1);}

请告诉我。谢谢!

脱毒前体

我对此的解决方案是创建两个div(或一个附加的div来包装您的当前元素),然后将另一个设置为第一个,以此类推。它们将位于单独的div上,但看起来仍然像在一个div中。

可能需要一些空白/填充来使它们全部对齐。

本文收集自互联网,转载请注明来源。

如有侵权,请联系 [email protected] 删除。

编辑于
0

我来说两句

0 条评论
登录 后参与评论

相关文章