+ 5

Help please?

I can not seem to get this to work... what is the best way of playing an animation oncklick? https://sololearn.com/compiler-playground/WgaYjYkc34lV/?ref=app

20th Nov 2024, 4:41 PM
Daniel
Daniel - avatar
30 odpowiedzi
+ 3
Daniel here is a no js version. the trick is to use :hover to set the animation and :active to remove it. I also tweaked the style a bit. https://sololearn.com/compiler-playground/WfujKK9i85xz/?ref=app
22nd Nov 2024, 10:12 AM
Bob_Li
Bob_Li - avatar
+ 6
Thank you so much😀 however,it only works once....
20th Nov 2024, 6:08 PM
Daniel
Daniel - avatar
+ 6
Wow,thanks I did not know you could do that..
20th Nov 2024, 6:39 PM
Daniel
Daniel - avatar
+ 4
I cannot seem to make a onclick animation.. If you can't help,it's fine
20th Nov 2024, 5:52 PM
Daniel
Daniel - avatar
+ 4
I added comments in the CSS and the Javascript tab. I short: On clicking, we add the animation as CSS class and remove it again after a certain duration. This way, we can add it again on the next click. In your CSS there appears to be a problem: there is no closing } for the body? https://sololearn.com/compiler-playground/WZLWPbn1UK1T/?ref=app
20th Nov 2024, 6:34 PM
Lisa
Lisa - avatar
+ 4
Thanks Bob_Li
22nd Nov 2024, 12:06 PM
Daniel
Daniel - avatar
22nd Nov 2024, 10:14 AM
Juan Angel Luzardo Muslera
Juan Angel Luzardo Muslera - avatar
+ 2
when I write onclick="x()" instead of onclick="x" it started to spin. Is this what you wanted to achieve?
20th Nov 2024, 6:07 PM
Lisa
Lisa - avatar
+ 2
I see u have started fronted for beginners. It's a good start.keep going😃
18th Dec 2024, 3:18 PM
Daniel
Daniel - avatar
+ 2
Hmmm I can help, but I'm only just started about half a year ago with web
18th Dec 2024, 3:23 PM
Daniel
Daniel - avatar
+ 2
Yeah..well...I'm in school
18th Dec 2024, 3:26 PM
Daniel
Daniel - avatar
+ 2
me too. You r from UK.. right?
18th Dec 2024, 3:27 PM
ĪīVS
ĪīVS - avatar
+ 2
U india
18th Dec 2024, 3:27 PM
Daniel
Daniel - avatar
+ 2
😁👍🏼
18th Dec 2024, 3:29 PM
Daniel
Daniel - avatar
+ 2
So,you have started python and web.
18th Dec 2024, 3:29 PM
Daniel
Daniel - avatar
+ 1
What is "this"?
20th Nov 2024, 5:07 PM
Lisa
Lisa - avatar
+ 1
Read the comment instead of just upvoting it. If you need help with your code, link your code.
20th Nov 2024, 5:44 PM
Lisa
Lisa - avatar
+ 1
Hey Daniel, can you able to see my comment
18th Dec 2024, 2:56 PM
ĪīVS
ĪīVS - avatar
+ 1
Yup
18th Dec 2024, 2:57 PM
Daniel
Daniel - avatar