Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

177
Visualizações
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 Respostas
Responde à pergunta

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 Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda