Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

135
Visualizações
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 Respostas
Responde à pergunta

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 Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda