Answers for "typing text animation javascript"

4

javascript text auto writing

/*
  Creating a Typing Effect
-----------------------------
1) Add HTML: */
<p id="demo"></p>
<button onclick="typeWriter()">Click me</button>
/* 
2) Add JavaScript: */
var i = 0;
var txt = 'Lorem ipsum typing effect!'; /* The text */
var speed = 50; /* The speed/duration of the effect in milliseconds */

function typeWriter() {
  if (i < txt.length) {
    document.getElementById("demo").innerHTML += txt.charAt(i);
    i++;
    setTimeout(typeWriter, speed);
  }
}
Posted by: Guest on July-28-2020
0

animated typing js

<script src="https://unpkg.com/typewriter-effect@latest/dist/core.js"></script>
var app = document.getElementById('app');

        var typewriter = new Typewriter(app, {
            loop: true,
            delay: 75,
        });

        typewriter
            .pauseFor(500)
            .typeString('Websites')
            .pauseFor(500)
            .deleteChars(9)
            .pauseFor(500)
            .typeString('Messenger')
            .pauseFor(500)
            .deleteChars(9)
            .pauseFor(500)
            .typeString('Instagram')
            .pauseFor(500)
            .deleteChars(9)
            .pauseFor(500)
            .typeString('Whats App')
            .pauseFor(500)
            .deleteChars(9)
            .pauseFor(1000)
            .start();
Posted by: Guest on October-14-2021

Browse Popular Code Answers by Language