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

119
Views
Show counter text, every four beats

I have a counter and every four steps plays a sound. Every four steps is a meter. What I want is, every 4 steps of 32, to write on the screen 1, 2, 3, 4, 5, 6, 7, 8.

For example: enter image description here

What I have made works 100%, but is there a better way to do that and to save space? Thanks!

if(Step == 0) document.getElementById('counter').innerHTML = "1";

if(Step == 4) document.getElementById('counter').innerHTML = "2";

if(Step == 8) document.getElementById('counter').innerHTML = "3";

if(Step == 12) document.getElementById('counter').innerHTML = "4";

if(Step == 16) document.getElementById('counter').innerHTML = "5";

if(Step == 20) document.getElementById('counter').innerHTML = "6";

if(Step == 24) document.getElementById('counter').innerHTML = "7";

if(Step == 28) document.getElementById('counter').innerHTML = "8";

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

if(Step%4 == 0){
   document.getElementById('counter').innerHTML = Step/4 + 1;
}
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!