Well, I'm making a game in HTML5 + CSS3 + JavaScript and I'm in the part of the initial menu. I wanted the button before redirecting the page to make an animation. The animation part is working fine, but from the moment I enter that part of the code to redirect the page, it stops running the animation. Does anyone know how to help? Below I leave the code part in JavaScript.
function ajuda(){
this.style.backgroundPosition = "right";
var sombotao = document.getElementById("sombotao");
sombotao.play();
window.location.href="ajuda.html";
}