Again a question about animation.šŸ˜ | Sololearn: Learn to code for FREE!
Novo curso! Todo programador deveria aprender IA generativa!
Experimente uma aula grƔtis
+ 5

Again a question about animation.šŸ˜

I have made an animation as follows: https://code.sololearn.com/WtGmq63AVGb4/?ref=app First click the purple button, then the blue, and then the cyan button and see the changes. I want that when I click the blue button, the red colour in the signal vanishes, and when I click the cyan button, the yellow colour in the signal vanishes. Can anyone please tell me how do I do it? If possible please do.it for me so that I can understand. Thanks!ā˜ŗšŸ‘

23rd Jun 2018, 6:50 AM
Rahul Hemdev
Rahul Hemdev - avatar
2 Respostas
+ 2
instead of adding an onlick to the HTML elements you should rather add an event listener and conditionals to check the style is already red, yellow or green respectively. then perform actions based in the current fill colour. I hope this helps you thanks
23rd Jun 2018, 7:01 AM
Peter Claver
Peter Claver - avatar
+ 2
Dark Ranger event listeners are added in javascript
23rd Jun 2018, 7:49 AM
Peter Claver
Peter Claver - avatar