Hola, estoy creando un efecto de escritura usando la biblioteca Type Js y quiero saber si hay alguna manera de saber que el efecto Typed JS está completo.
Cualquier tipo de ayuda es muy apreciada :)
var typed = new Typed('.typed', { stringsElement: '.typed-strings', loop:false }); <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="viewport" content="wclassth=device-wclassth, initial-scale=1.0"> <script src="https://code.jquery.com/jquery-3.6.0.min.js" integrity="sha256-/xUj+3OJU5yExlq6GSYGSHk7tPXikynS7ogEvDej/m4=" crossorigin="anonymous"></script> <script src="https://cdn.jsdelivr.net/npm/typed.js@2.0.12"></script> <title>Document</title> </head> <body> <div class="typed-strings"> <p>Typed.js is a <strong>JavaScript</strong> library.</p> <p>It <em>types</em> out sentences.</p> </div> <span class="typed"></span> </body> </html>Un vistazo rápido a la documentación de la biblioteca muestra que hay un parámetro onComplete que toma una función: enlace de documentos
En onComplete puede establecer una variable para marcar la animación como completada.
let isEffectComplete = false; const typed = new Typed('.typed', { stringsElement: '.typed-strings', loop:false, onComplete: () => { isEffectComplete = true }, });