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

169
Vistas
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 Respuestas
Responde la pregunta

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 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