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

103
Views
mostrar espacios en blanco y saltos de línea en la función de efecto de texto de terminal

Me gustaría mostrar espacios de caracteres en blanco y saltos de línea en mi función de Efecto de texto de terminal. En este momento, solo mostrará un espacio en blanco y esperará hasta el siguiente carácter, también ignorará por completo cualquier tipo de salto de línea en mi cadena:/

Aquí está mi html:

 <div class="console-container"> <span id="text"></span> <div class="console-underscore" id="console"></div> </div>

y el javascript:

 consoleText( [ "hugo@Hugos-MacBook-Pro ~ % ", "All projects made with love", ], "text" ); function consoleText(words, id) { var visible = true; var con = document.getElementById("console"); var letterCount = 1; var x = 1; var waiting = false; var target = document.getElementById(id); window.setInterval(function () { if (letterCount === 0 && waiting === false) { waiting = true; target.innerHTML = words[0].substring(0, letterCount); window.setTimeout(function () { var usedWord = words.shift(); words.push(usedWord); x = 1; letterCount += x; waiting = false; }, 1000); } else if (letterCount === words[0].length + 1 && waiting === false) { waiting = true; window.setTimeout(function () { x = -1; letterCount += x; waiting = false; }, 1000); } else if (waiting === false) { target.innerHTML = words[0].substring(0, letterCount); letterCount += x; } }, 50); }

Lo siento si parece una pregunta estúpida, soy bastante nuevo en la programación :)

Muchas gracias !

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!