0
  1. Click function is working properly.

  2. But if we click the hand img more than one time it is not working when page is reloaded, below is the code.

    $(document).ready(function(){
        $("#container .like a img").click(function(){
            $("#container .balloons a img").addClass("anima");
            });
        });
    
  3. I want more than one click will be work, please solve the problem.

  4. Here is the fiddle: http://jsfiddle.net/vamsivelaga/n3no4759/

leppie
  • 115,091
  • 17
  • 196
  • 297
  • The answer to this question provides good insight - http://stackoverflow.com/questions/4797675/how-do-i-re-trigger-a-webkit-css-animation-via-javascript – Chintan S Jan 21 '15 at 07:37

2 Answers2

3

check this out

$("#container .like a img").on("click", function(){
    $("#container .balloons a img").addClass("anima").one('webkitAnimationEnd mozAnimationEnd MSAnimationEnd oanimationend animationend' , function(event){   
        $(this).removeClass("anima");
    });

});

here the working solution

http://jsfiddle.net/muhaimincs/n3no4759/14/

Muhaimin
  • 1,643
  • 2
  • 24
  • 48
0

The problem is that you don't remove anima class. You can use setTimeout function to do this:

$(document).ready(function(){
    $("#container .like a img").click(function(){
        $("#container .balloons a img").addClass("anima");
        setTimeout(function() {
            $("#container .balloons a img").removeClass("anima");
        }, 500)
        });
    });
segarci
  • 739
  • 1
  • 11
  • 19