0

I have a page that displays people's pictures. I have an animated gif over each picture so that when people click on it, it plays a short animation with transparency so that it looks like the person is getting slapped in the face. Here is my line of code:

 <img class="slap_animation" src="/images/slap-in-the-face-still.gif" alt="" onclick='this.src="/images/slap-in-the-face.gif"' />

It works perfectly but I want to do more with it. I want to make it so that when people click on it, the animation plays and on the last frame, it performs a symfony action to add +1 to the "slapcount" field. What is the easiest way to do this? The animation is just about 2 seconds long.

GoRivera
  • 173
  • 1
  • 13

1 Answers1

0

You can make a timer that every 2 seconds will add +1 to your "slapcount". When the animation is running enable the timer and when it is not disable it.