首先向后运行Animation,然后使用CSS向前运行
使用animation-direction属性可以先向后运行动画,然后再向前运行动画。该属性与交替反向动画值一起使用可实现此目的。
示例
<!DOCTYPE html>
<html>
<head>
<style>
div {
width: 150px;
height: 200px;
position: relative;
background-color: yellow;
animation-name: myanim;
animation-duration: 2s;
animation-direction: alternate-reverse;
animation-iteration-count: 3;
}
@keyframes myanim {
0% {background-color:green; left:0px; top:0px;}
50% {background-color:maroon; left:100px; top:100px;}
100% {background-color:gray; left:0px; top:0px;}
}
</style>
</head>
<body>
<div></div>
</body>
</html>热门推荐
10 舅舅大婚文案祝福语简短
11 二胎祝福语简短霸气
12 祝福语年轻回复文案简短
13 怎样给人送祝福语简短
14 庆祝论坛周年祝福语简短
15 考试祝福语简短给对象
16 岁岁祝福语简短独特
17 爱小姨文案祝福语简短
18 宝宝祝福语诗意简短 古文