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

165
Views
Clicking a Button on iPad or Android slow using Javascript

If I click faster than approx 500ms, clicks get lost. I'm clicking ABABAB... I've tried onclick as well, same problem.

  • Try here: https://christernilsson.github.io/2021/033-MM5040/index.html
  • Code: https://github.com/ChristerNilsson/2021/blob/main/033-MM5040/js/sketch2.js
body = document.getElementById "body"
d = null
command = ''
start = new Date()

f = (title) =>
    res = document.createElement 'button'
    res.innerHTML = title
    res.style = "width:300px;height:300px"
    body.appendChild res
    res.ontouchstart = =>
        t = new Date()
        command += title + "#{t-start} "
        d.innerHTML = command
        start = t

f 'A'
f 'B'
d = document.createElement 'div'
d.innerHTML = '104'
body.appendChild d
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

I found an answer.

ontouchend

Now down to about 150ms. So, I will use onclick on Windows/Mac and ontouchend for touch screens.

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!