¿Cómo puedo obtener una animación CSS para jugar con un JavaScript onClick? Actualmente tengo:Animación CSS onClick
.classname {
-webkit-animation-name: cssAnimation;
-webkit-animation-duration:3s;
-webkit-animation-iteration-count: 1;
-webkit-animation-timing-function: ease;
-webkit-animation-fill-mode: forwards;
}
@-webkit-keyframes cssAnimation {
from {
-webkit-transform: rotate(0deg) scale(1) skew(0deg) translate(100px);
}
to {
-webkit-transform: rotate(0deg) scale(2) skew(0deg) translate(100px);
}
}
¿Cómo puedo aplicar un onClick?
Solo tenga en cuenta que el uso de '.className' borrará todas sus otras clases en el elemento dado. Si esto no se desea, use 'document.getElementById ('img'). ClassList.add ('classname');' –