Manually stepping through CSS animation with JavaScript
If I have a CSS keyframe animation like this @keyframes flash-red { 50% { background: #f00; } } #goflash.anm-flash { animation-name: flash-red; animation-duration: .5s; background: rgba(255, 0, 0, 0); } Then I can always trigger the animation like this: var gf = document.querySelector("#goflash"); gf.classList.remove("anm-flash"); setTimeout(function() { gf.classList.add("anm-flash"); }, 50); Is there any way to override the animation-duration/animation-timing-function to be dependent on JavaScript? I'd like to be able to say something like gf.animate("flash-red", "50%") to make the background