Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

190
Views
¿Cómo puedo mostrar un conjunto de imágenes y pasar a otro en un bucle usando Velocity.JS?

Tengo 3 conjuntos de imágenes. Yo quiero:

  1. Mostrar conjunto 1 (será visible al cargar la página)
  2. Ocultar conjunto 1 y mostrar conjunto 2
  3. Ocultar conjunto 2 y mostrar conjunto 3
  4. Regresa al inicio

Estoy usando Velocity.js, sin embargo, me cuesta pensar en la mejor manera de estructurar esto.

Esto me acerca un poco, pero casi necesito decirle a Velocity que espere hasta que termine un conjunto antes de comenzar con el siguiente:

 const products = [ "shoes", "tablet", "cushion", "phonecase", "sticker", "t-shirt", "cup", "jacket", ]; let set1 = []; products.forEach((product) => { set1.push(document.getElementById(`hero-${product}-1`)); }); let set2 = []; products.forEach((product) => { set2.push(document.getElementById(`hero-${product}-2`)); }); let set3 = []; products.forEach((product) => { set3.push(document.getElementById(`hero-${product}-3`)); }); set1.forEach((item, index) => { Velocity( item, { opacity: 0, }, { loop: true, delay: 30000 + 100 * index, } ); }); set2.forEach((item, index) => { Velocity( item, { opacity: 1, }, { loop: true, delay: 20000 + 100 * index, } ); }); set3.forEach((item, index) => { Velocity( item, { opacity: 1, }, { loop: true, delay: 10000 + 100 * index, } ); });
about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!