Reputation: 47
I'm trying to add custom css animations to some images, but I just can't seem to get my head wrapped around the solution. My code is found below. On window load I would like the class 'animated shake' to be added to the element with the id "blue". After the animation occurs, remove the animation class.
$(window).load(function(){
$("#blue").addClass('animated shake').0ne('webkitAnimationEnd mozAnimationEnd MSAnimationEnd oanimationend animationend',function(){
$(this).removeClass('animated shake');
});
};
Upvotes: 0
Views: 574
Reputation: 903
Do you not use the console to debug? You have a typo and missing parenthases that would have shown if you did.
$(window).load(function(){
$("#blue").addClass('animated shake')
.one('webkitAnimationEnd mozAnimationEnd MSAnimationEnd oanimationend animationend',function(){
$(this).removeClass('animated shake');
});
});
Upvotes: 0