CSS Animations | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 2

CSS Animations

So, I have just learnt how to make CSS animations, however I am struggling with using javascript to control it. Like if you type in the number 56 it moves but I am unsure of how to do that. I tried but failed could someone please help. Below is the link! https://code.sololearn.com/W66SVq4CZYdu/#css

3rd Jan 2018, 3:19 PM
Zakariya
Zakariya - avatar
2 Answers
+ 2
ok thanks
4th Jan 2018, 10:29 PM
Zakariya
Zakariya - avatar
+ 1
add this line in your function qwerty.classList.toggle("animate") and paste this code in your css.. and remove the one from the div css .animate{ -webkit-animation-name: example; /* Safari 4.0 - 8.0 */ -webkit-animation-duration: 4s; /* Safari 4.0 - 8.0 */ animation-name: example; animation-duration: 4s; }
3rd Jan 2018, 3:36 PM
Мг. Кнап🌠
Мг. Кнап🌠 - avatar