Jump to content

Type Writer Repeat ?


mghoniem

Recommended Posts

Hello All, i have the below code. 
Type writer effect.  Java. 
I would like for the text animation to keep repeating every 2 seconds . 
if you cab plz help me. im not so good at java

\\\\\\\\\\ CODE BELOW \\\\\\\\\\

 

<!DOCTYPE html>
<html>
<body>


<div class="text">
<p id="demo"></p>

<script>
var i = 0;
var txt = 'APEX LEGANDS SEASON 5 IS ON JUNE 3th this text can go on forever and much more, if you like it it will go on 2 lines and do much more , you jst eed to figre out how to change text font and colors and repeate';
var speed = 40;

function typeWriter() {
  if (i < txt.length) {
    document.getElementById("demo").innerHTML += txt.charAt(i);
    i++;
    setTimeout(typeWriter, speed);
  }
}
</script>
<style>

.text {
  color: green;
    font-size: 50px;

}
</style>
</head>
<body onload="typeWriter()">


</body>
</html>

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...