Removing hover from this animation, so it doesn't use hover

Hi there,

I have the following which animates an image on hover, but I would like the animation to happen without hovering, so it happens when the page loads.

$(".smile-1").bind("webkitAnimationEnd mozAnimationEnd animationEnd", function(){
  $(this).removeClass("animated-1")  
})

$(".smile-1").hover(function(){
  $(this).addClass("animated-1");        
})

This is what I have tried that doesn’t work:

$(".smile-1").bind("webkitAnimationEnd mozAnimationEnd animationEnd", function(){
  $(this).removeClass("animated-1")  
})

$(".smile-1")(function(){
  $(this).addClass("animated-1");        
})

Can anyone suggest how I can have the animation playing all the time?

Thanks

Why can’t you just add the class manually to the relevant HTML?

2 Likes

Yes, that would work :slight_smile:

Thanks :slight_smile:

1 Like

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.