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

312
Views
¿Cómo podría eliminar el efecto :: after usando JS?

Quiero eliminar el efecto ::after después de que se complete una función usando JS.

Aquí está el código:

 let text = 'Stack Overflow is a question and answer website for professional and enthusiast programmers. It is the flagship site of the Stack Exchange Network,[4][5][6] created in 2008 by Jeff Atwood and Joel Spolsky' let interval; let i = 0; interval = setInterval(function() { if (i < text.length) { document.querySelector('div').textContent += text.charAt(i) } else { window.clearInterval(interval) } i++ }, 20)
 div::after { content: '|' }
 <div></div>

Me pregunto si hay alguna manera de eliminar el "|" ( ::after effect) después de que terminó el interval .

¡Gracias por cualquier respuesta!

about 4 years ago · Santiago Trujillo
1 answers
Answer question

0

Si agrega una clase a su definición, puede cambiar esta y desactivarla

div.foo::después{ contenido:'|' }

 setInterval(function(){ if(i<text.length){ document.querySelector('div').textContent += text.charAt(i) } else{ window.clearInterval(interval) document.querySelector('div').classList.remove("foo"); } i++ },20)
about 4 years ago · Santiago Trujillo 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!