I did a slow infinite CSS3
animation. It animates from top:0;
to top:40px;
. The error is when the animate ends, it jumps to the start point. I think it should jump with ease
or ease-in
but that's not happening. I tried a lot to fix this, but I failed.
I need the return transition to have an ease-in
effect.
My Code:
span {
margin-left: 200px;
}
/** Down Slow Animation **/
@-webkit-keyframes downSlow {
from { top: 0px; }
to { top: 40px; }
}
@-moz-keyframes downSlow {
from { top: 0px; }
to { top: 40px; }
}
@keyframes downSlow {
from { top: 0px; }
to { top: 40px; }
}
.down-slow {
position: relative;
-webkit-animation: downSlow 1.5s infinite;
-moz-animation: downSlow 1.5s infinite;
animation: downSlow 1.5s infinite;
-webkit-animation-fill-mode: forwards;
-moz-animation-fill-mode: forwards;
animation-fill-mode: forwards;
}
<link href="//maxcdn.bootstrapcdn.com/font-awesome/4.3.0/css/font-awesome.min.css" rel="stylesheet" />
<span class="down-slow"><i class="fa fa-angle-down fa-5x"></i></span>
This is just an alternative solution
Just add
alternate
ant the end ofanimation
.The same code can be reduce to
A much better approach would be to use
translate
this way your element will not interfere with other DOM elementsBut again you can reduce this with prefixfree frind a cdn here
at the end set speed/2
REF: animation-fill-mode