Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

179
Vistas
Play lottie file on button click

So I'm trying to create this little web game where when you press a button a Lottie animation should be played

This is what I've tried so far but it's not working for me, any help would be greatly appreciated :)

<div id="hank"></div>

   <script>
       var menu = bodymovin.loadAnimation({ 
           container: document.getElementById('hank'), 
           renderer: 'svg', 
           loop: false, 
           autoplay: false, 
           path: 'hank.json',
        }) 
           
           document.getElementById('correctAnswer').addEventListener('click', function(){ menu.playSegments([0,180],true); })
</script>

<button id="correctAnswer"> Answer 1 </button>
<button> Answer 2 </button>
about 4 years ago · Juan Pablo Isaza
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda