Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

175
Views
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 answers
Answer question

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 Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!