Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

176
Vistas
Can you tell me why this alert does not work?

Can you tell me why this alert does not work?

my js codes:

var character =
document.getElementById("character");
var block = document.getElementById("block");




function jump() {
if (character.classList != "animate") {
    character.classList.add("animate");
}

setTimeout(function () {
    character.classList.remove("animate");
}, 500);

var checkDead = setlnterval(function () {
    var characterTop =
        parseInt(window.getComputedStyle(character)
            .getPropertyValue("top"));

    var blockLeft =
        parseInt(window.getComputedStyle(block)
            .getPropertyValue("left"));
   

here is the if part (my problem): i want to know why it dose not work?

        if (blockLeft<20 && blockLeft>0 && characterTop>=130) {
        block.style.animation = "none";
        block.style.display = "none";
        alert("U Lose!");
    }
}, 10);

}

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

If there will be two alert boxes when you run the code, then check the "prevent this page from creating additional dialog" checkbox. Refresh the page again and you won't get the alert box ever again.

Solution is that you need to close that webpage and reopen it again in the browser (don't need to close the entire browser). I am assuming you are using Chrome. Internet Explorer or Firefox don't have this checkbox feature.

about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda