I have an attached CSS animation that basically works fine:
#product { background: red; width: 10%; height: 10%; border: none; left: -22%; top: 50%; top: 40%; animation: product_across 2s linear, product_down 1s; animation-delay: 0s, 2s; } @-moz-keyframes product_across { from { left: -22%; } to { left: 98%; } } @-moz-keyframes product_down { from { top: 40%; left: 98%; } to { top: 98%; left: 128.5%; } }
The fact is that after the completion of the first animation ( product_across ) I want to apply a style. Do not animate it, just apply it.
Does CSS3 support this? Iβm probably looking for a peculiar property βat the end of the animationβ or something like that.
At the moment I will get around it:
@-moz-keyframes product_down { from { -moz-transform: rotate(45deg); top: 40%; left: 98%; } to { -moz-transform: rotate(45deg); top: 98%; left: 128.5%; } }
... where the twist is the style I want to apply. By setting the from / to states to the same value for this property, it effectively does what I want, but I can't help but think that there should be a better way.
source share