【发布时间】:2021-05-14 00:47:38
【问题描述】:
尝试将 div 滑入,等待,然后再次将其滑回视野之外。
我试过的代码..
<div class="content slidein-wait-slideout-animation">content to display...</div>
.content {
background-color: #ccc;
height: 200px;
width: 100%;
}
.slidein-wait-slideout-animation {
animation: slidein 4000ms, slideout 10000ms;
}
@keyframes slidein {
0% { width: 0; opacity: 0; }
10% { width: 10%; opacity: 0; }
50% { width: 50%; opacity: 0; }
100% { width: 100%; }
}
@keyframes slideout {
0% { width: 100%; }
10% { width: 50%; opacity: 0; }
50% { width: 10%; opacity: 0; }
100% { width: 0; opacity: 0; }
}
哪个不滑进去,等着又滑出来,此刻更像是突然现身,不会消失。
【问题讨论】:
标签: html css css-animations