【发布时间】:2020-07-03 06:36:28
【问题描述】:
目前,我不明白为什么我的动画只在一个方向上工作。
我已经输入了the whole example here online。
如果我使用两个关键帧,一切正常:
.show {
animation: showMe 0.4s;
}
.hide {
opacity: 0;
margin-top: -80px;
animation: hideMe 0.3s;
}
@keyframes hideMe {
0% {
opacity: 1;
margin-top: 20px;
}
100% {
opacity: 0;
margin-top: -80px;
}
}
@keyframes showMe {
0% {
opacity: 0;
margin-top: -80px;
}
100% {
opacity: 1;
margin-top: 20px;
}
}
但我认为如果我在reverse 方向重用hideMe,它也应该与.show 一起使用,类似于
.show {
animation: hideMe 0.4s reverse;
}
而不是
.show {
animation: showMe 0.4s;
}
我误解了这个概念吗?
【问题讨论】:
标签: html css angular animation