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

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

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