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

116
Vistas
How to animate from length 0 -> 100 but remove animation from 100 -> 0

I have this timeline

<div class="timeline-wrapper">
 <div class="timeline-item">
   <div class="timeline-loaded" style="width: 100%"></div>
 </div>
 <div class="timeline-item">
   <div class="timeline-loaded" style="width: 100%"></div>
 </div>
 <div class="timeline-item">
   <div class="timeline-loaded" style="width: 83%"></div>
 </div>
</div>

So the last item goes up from to 84, 85 etc. but when i reset the timeline i want to have all the items style width: 0% but then it has the transition animation so u see that it goes to 0 but it needs to go to 0 instantly and smoothly fill from 0 to 100%.

Any help is welcome!

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

By reading your question what I got is you need some progressbar. You can refer to this. https://www.w3schools.com/howto/howto_js_progressbar.asp

var i = 0;
function move() {
  if (i == 0) {
    i = 1;
    var elem = document.getElementById("myBar");
    var width = 1;
    var id = setInterval(frame, 10);
    function frame() {
      if (width >= 100) {
        clearInterval(id);
        i = 0;
      } else {
        width++;
        elem.style.width = width + "%";
      }
    }
  }
}

Basically it will modify width of your class. If you need more help on this please elaborate your requirement more with jsfiddle or any same.

about 4 years ago · Juan Pablo Isaza Denunciar
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