I have a div which spins:
<div class="medium animated"></div>
.medium {
position: absolute;
width: 100px;
height: 100px;
}
.animated {
animation: spin 5s linear infinite;
}
@keyframes spin { 100% { -webkit-transform: rotate(360deg); transform:rotate(360deg); } }
I want it to stop when I click on it. I add animation-play-state: paused
in onClick event listener and it works good everywhere except iOS and Android Browser
So, okay, I want just stop the animation on click in those browsers, not pause. So I remove animated
class from the DIV
. It works in iOS, but doesn't work in Android Browser. The DIV
continues to spin.
How can I stop the animation in Android Browser?
Here is jsfiddle with an example