【发布时间】:2020-03-26 23:51:48
【问题描述】:
我试着问我的问题很简单...... 我这里有 3 个盒子,我有所有的动画 我正在使用 webkate 帧制作动画 如果我是这样开始的,它将在页面加载时执行动画,但我希望它在我悬停另一个元素时执行动画...
HTML 代码:
<div class="Ball1" id="Ball1">
</div>
<div class="Ball2" id="Ball2">
</div>
<div class="Ball3" id="Ball3">
</div>
CSS 代码:
#Ball1,#Ball2,#Ball3 {
height: 200px;
width: 200px;
margin-left: auto;
margin-right: auto;
border-radius: 60%;
}
//An Element... For Example a text or a box or body or anything else
#anelemnt:hover > #Ball1,#Ball2,#Ball3 {
-webkit-animation: puff-in-center 0.7s cubic-bezier(0.470, 0.000,
0.745, 0.715) both;
animation: puff-in-center 0.7s cubic-bezier(0.470, 0.000, 0.745,
0.715) both;
}
@-webkit-keyframes puff-in-center {
0% {
-webkit-transform: scale(2);
transform: scale(2);
-webkit-filter: blur(4px);
filter: blur(4px);
opacity: 0;
}
100% {
-webkit-transform: scale(1);
transform: scale(1);
-webkit-filter: blur(0px);
filter: blur(0px);
opacity: 1;
}
}
@keyframes puff-in-center {
0% {
-webkit-transform: scale(2);
transform: scale(2);
-webkit-filter: blur(4px);
filter: blur(4px);
opacity: 0;
}
100% {
-webkit-transform: scale(1);
transform: scale(1);
-webkit-filter: blur(0px);
filter: blur(0px);
opacity: 1;
}
}
///////
【问题讨论】:
标签: javascript html css css-animations frames