If I hide an element with display: none;
, and then show it at a later time with $(".fa-spin").show()
the fa-spin
animation doesn't work.
Note that everything works properly if the element is not hidden in the beginning but is hidden later with:
$(".fa-spin").hide()
This is the .fa-spin
implementation:
.fa-spin {
-webkit-animation: fa-spin 2s infinite linear;
animation: fa-spin 2s infinite linear;
}
@-webkit-keyframes fa-spin {
0% {
-webkit-transform: rotate(0deg);
transform: rotate(0deg);
}
100% {
-webkit-transform: rotate(359deg);
transform: rotate(359deg);
}
}
Can you explain this behavior?
I am asking the reason of this behavior, not workarounds.