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

359
Visualizações
Intentando obtener un efecto de máquina de escribir, pero no aparece el texto

Estoy tratando de obtener un efecto de escritura a máquina para una frase (línea 13), pero cuando ejecuto el código, no aparece. El código está abajo:

 <!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>Contact</title> <link href="images/mouth.png" rel="shortcut icon"> <link href="/style.css" rel="stylesheet" type="text/css" media="all"> <script> var i= 0; var text= 'Please leave a message after the beep. If you are finished recording, hang up, or press 1 for more options.'; var speed = 50; function typeWriter() { if (i < txt.length { document.getElementById("typing").innerHTML += txt.charAt(i); i++; setTimeout(typeWriter, speed); } } </script> </head> <body> <div class="topnav"> <a href="index.html">Home</a> <a href="aboutme.html">About Me</a> <a class="active" href="contact.html">Contact</a> </div> <div class="row" onload="typeWriter();"> <div class="column equal"> <iframe src="https://docs.google.com/forms/d/e/1FAIpQLSdx7Wq9HrjElE6ExYwBLDgAittD0H73kQLvBeIOk7PgeQKljg/viewform?embedded=true" width="640" height="800" frameborder="0" marginheight="0" marginwidth="0">Loading…</iframe> </div> <div class="column equal" onload="typeWriter();"> <!-- empty... for now --> </div> </div> </html>

Tampoco funciona cuando pongo la onload en la declaración del cuerpo.

about 4 years ago · Santiago Gelvez
1 Respostas
Responde à pergunta

0

Mi amigo, por favor revise su código/sintaxis cuando escriba . en su código hay muchos errores de sintaxis, por ejemplo:" variable 'txt'","div id 'escribiendo' no está allí". A algunos les gusta más error.

 <!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>Contact</title> <link href="images/mouth.png" rel="shortcut icon"> <link href="/style.css" rel="stylesheet" type="text/css" media="all"> </head> <body> <div class="topnav"> <a href="index.html">Home</a> <a href="aboutme.html">About Me</a> <a class="active" href="contact.html">Contact</a> </div> <div > here you effect Ꮚˊ•⌔•ˋᏊ // you was not add the id 'typing' <p id="typing"></p> </div> <div class="row" id="googleForm"> <div class="column equal"> <iframe src="https://docs.google.com/forms/d/e/1FAIpQLSdx7Wq9HrjElE6ExYwBLDgAittD0H73kQLvBeIOk7PgeQKljg/viewform?embedded=true" width="640" height="800" frameborder="0" marginheight="0" marginwidth="0">Loading…</iframe> </div> <div class="column equal" onload=typeWriter()> <!-- empty... for now --> </div> </div> <script> var i= 0; var text= 'Please leave a message after the beep. If you are finished recording, hang up, or press 1 for more options.'; var speed = 50; const googleForm = document.getElementById("googleForm"); function typeWriter() { if (i < text.length ){ document.getElementById("typing").innerHTML += text.charAt(i); i++; setTimeout(typeWriter, speed); } } googleForm.onload = typeWriter(); </script> </body> </html>

Puede intentar usarlo en javascript: es una buena práctica separar javascript de html. También es posible que desee verificar la consola de Javascript en busca de errores.

about 4 years ago · Santiago Gelvez 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