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

167
Views
El evento "touchstart" utilizado para un "doble toque" evita que el desplazamiento funcione al deslizar hacia arriba o hacia abajo

Agregué un evento "touchstart" a un "tbody" para que se produzca una función cuando toco dos veces en una fila. Esto funciona perfectamente PERO evita el desplazamiento hacia arriba o hacia abajo en el dispositivo móvil (por lo que si mi tabla tiene suficientes filas, se quedará atascado)

 //DoubleClick not working on doubleTap, so... $("tbody").on("touchstart", tapHandler); var tapedTwice = false; function tapHandler(e) { if(!tapedTwice) { tapedTwice = true; setTimeout( function() { tapedTwice = false; }, 300 ); //doubletap speed return false; } e.preventDefault();//Prevents zoom, but without it, scroll still not working lightboxPrint(e); //Fx for this event }

Ya intente eliminar todo el CSS y Bootstrap. La única función que da problemas es esta. Si esto se puede arreglar, ¿puedo agregar un nuevo evento para "deslizar hacia arriba" o "deslizar hacia abajo" para desplazarme?

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

0

Estoy respondiendo con las palabras de Terry, solo para cerrar la pregunta. Él debería recibir todo el crédito. En lugar de comenzar con "tapedTwice = false", simplemente comencé con "tapedTwice = true" y cambié la función en consecuencia.

 $("tbody").on("touchstart", tapHandler); var tapedTwice = true; function tapHandler(e) { if(tapedTwice) { tapedTwice = false; setTimeout( function() { tapedTwice = true; }, 300 ); return true; } e.preventDefault();//Para evitar el zoom lightboxPrint(e); };
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!