Why is my animation broken?(JavaScript and CSS experts) | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 3

Why is my animation broken?(JavaScript and CSS experts)

Why is the animation running only for "text 1"? Is there something wrong? https://code.sololearn.com/W5zyNvBrh3T2/?ref=app

23rd Feb 2022, 7:18 AM
Rishi
Rishi - avatar
6 Answers
+ 3
Rishi Try using appendChild instead of adding and removing class https://code.sololearn.com/W6OLAmdWm08Y/?ref=app
23rd Feb 2022, 10:54 AM
Raju Adhikary
Raju Adhikary - avatar
+ 5
You have to overwork the function rollNextSentence(); For example put a parameter with text variable and repeat calling for each array item.
23rd Feb 2022, 8:16 AM
JaScript
JaScript - avatar
+ 2
JaScript i don't understand, can you edit my code and share it pls?
23rd Feb 2022, 8:36 AM
Rishi
Rishi - avatar
+ 2
Raju Adhikary thank you very much 😃
23rd Feb 2022, 12:20 PM
Rishi
Rishi - avatar
+ 2
JaScript You forgot to add background to the color, the code is supposed to be like this @keyframes myAnimation{ 0%{ background-color:black; } 100%{ background-color:blue; } }
24th Feb 2022, 3:25 PM
Badru Olaoluwa
24th Feb 2022, 3:28 PM
Badru Olaoluwa