Below is my code, the keyframes animation only happens on first click. Any ideas?
Solved, see my answer below
JQUERY:
$(".audioplayer-playpause").click(function(){
$('.audioplayer-playpause').css({
//for firefox
"-moz-animation-name":"playPausePulse",
"-moz-animation-duration":"0.1s",
"-moz-animation-iteration-count":"1",
"-moz-animation-fill-mode":"forwards",
//for safari & chrome
"-webkit-animation-name":"playPausePulse",
"-webkit-animation-duration":"0.1s",
"-webkit-animation-iteration-count":"1",
"-webkit-animation-fill-mode":"forwards",
});
});
CSS:
@-moz-keyframes playPausePulse /*--for webkit--*/{
0% {background-color: rgba(0, 0, 0, 0.05);}
50% {background-color: rgba(0, 0, 0, 0.1);}
100% {background-color: rgba(0, 0, 0, 0.05);}
}
@-webkit-keyframes playPausePulse /*--for webkit--*/{
0% {background-color: rgba(0, 0, 0, 0.05);}
50% {background-color: rgba(0, 0, 0, 0.1);}
100% {background-color: rgba(0, 0, 0, 0.05);}
}
This is very relevant but I visited both reference links and couldn't find a solution that worked: run keyframes-animation on click more than once
Any help would be greatly appreciated.
Thanks. Thomas.