I currently have an animated image set up like this:
<div class="image_for_sping">
<img src="/anyimage.png">
</div>
The image has a style attribute added by jQuery which contains the following animation properties:
animation: spin360 0.1s linear 0s 20 forwards paused, spin360 0.25s linear 2s 8 forwards, spin360 0.5s linear 4s 4 forwards, spin360 1s linear 6s 2 forwards, spin90 2s linear 8s 1 forwards
This animation is created using the following CSS keyframes:
@-moz-keyframes spin360 { 100% { -moz-transform: rotate(-360deg); } }
@-webkit-keyframes spin360 { 100% { -webkit-transform: rotate(-360deg); } }
@keyframes spin360 { 100% { transform:rotate(-360deg); } }
@-moz-keyframes spin90 { 100% { -moz-transform: rotate(-90deg); } }
@-webkit-keyframes spin90 { 100% { -webkit-transform: rotate(-90deg); } }
@keyframes spin90 { 100% { -webkit-transform: rotate(-90deg); transform:rotate(-90deg); } }
Is there a way to replay this animation using jQuery without reloading the page?
You can try out an example here: https://jsfiddle.net/rzqc2bsh/1/