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

180
Views
¿Cómo rastrear la finalización de una función y agregar un controlador de eventos de clic?

¿Cómo puedo hacer que el controlador de eventos de clic acelere la función de tipo y luego reemplace el texto con el deseado?

Cada función de tipo () se ejecuta al desplazarse si el bloque aparece a la vista

Mi código

https://jsfiddle.net/sp_true/b5rj8mvd/4/

 function typeCode(lineItem) { const codeLine = lineItem.querySelector(".type"), columnBlock = lineItem.querySelector(".column"), code = codeLine.innerHTML, lengthContent = lineItem.querySelector(".hide-text").innerHTML.split('br').length let str = code, i = 0, isTag, text; columnBlock.innerHTML = Array(lengthContent + 1).fill(0).map((_, i) => `<span>${i+1}</span>`).join('<br>'); (function type() { text = str.slice(0, ++i); if (text === str) return; lineItem.querySelector('.type').innerHTML = text; let char = text.slice(-1); if (char === '<') isTag = true; if (char === '>') isTag = false; if (isTag) return type(); setTimeout(type, 40); // Here is speed to All Block left anim (60) }()); }
about 4 years ago · Juan Pablo Isaza
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!