I found this option that seems to work pretty easily:
CODE BLOCK
<h1>
Nulla fascilis
<span class="typed-words"></span>
</h1>
CODE INJECTION SECTION JS (INFINITE LOOPING)
<script src="https://unpkg.com/typed.js@2.0.16/dist/typed.umd.js"></script>
<script>
var options = {
strings: ['lorem', 'ipsum dolor', 'magna', 'vitae congue'],
typeSpeed: 100,
backSpeed: 50,
backDelay: 500,
startDelay: 1000,
loop: true,
};
var typed = new Typed('.typed-words', options);
</script>
That's for an infinite loop. If you want it without looping, replace the bottom section with this:
<script src="https://unpkg.com/typed.js@2.0.16/dist/typed.umd.js"></script>
<script>
var options = {
strings: ['lorem', 'ipsum dolor', 'magna', 'vitae congue'],
typeSpeed: 100,
backSpeed: 50,
backDelay: 500,
startDelay: 1000,
onComplete() {
$('.typed-cursor').remove(); //remove this line if you want to KEEP the cursor at the end
},
};
var typed = new Typed('.typed-words', options);
</script>