How to stop animation in specific time? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 3

How to stop animation in specific time?

Please tell me anyone!

1st Apr 2019, 4:26 PM
Shah Rabbani
Shah Rabbani - avatar
2 Answers
+ 11
If you want your animation to stop after some time , you can use: animation-iteration-count:K; The animation will stop after reaching 100% for the K time. But instead of K , write the number you want.
1st Apr 2019, 5:32 PM
🍇 Alex Tușinean 💜
🍇 Alex Tușinean 💜 - avatar
+ 2
You can also use setInterval(function, time). It takes 2 arguments. A function to call and how often to call it (in 'ms'). For ex: var myInterval = setInterval (func, 1000); That code will run 'func' every second. To stop it just use clearInterval(): clearInterval(myInterval);
15th Apr 2019, 3:17 AM
Albert Martinez
Albert Martinez - avatar