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

244
Visualizações
CountUp.js only works on the last element

I'm working on a page that has multiple stats that I want to countup. I'm using the CountUp jquery plugin here: http://pantrif.github.io/countUp.js/

I've verified in the console that values for each of the elements are there, but for some reason it only counts up the last matched element. I know I'm overlooking something. Any suggestions would be greatly appreciated. Here's the code I have:

$('.countup').each(function() { // each element with .countup class
            var countValue = $(this).attr('data-count-up'); //get value from data attribute
            console.log(countValue); // verify value is there
            var options = {
              useEasing : true,
              useGrouping : true,
              separator : ',',
              decimal : '.',
              prefix : '',
              suffix : ''
            };                
            var stat = $(this).CountUp(0, countValue, 1, 1.5, options); // countup with value
            stat.start(); // start the countup
        })

<ul class="stats">
<li class="anim-up delay-3">                        
    <div class="stat white">
        <span class="stat-number"><span class="countup" data-count-up="318830">318,830</span></span> homes and apartments financed
    </div>
</li>
<li class="anim-up delay-4">                        
    <div class="stat white">
        <span class="stat-number">$<span class="countup" data-count-up="30.1">30.1 billion</span></span> in real estate value produced
    </div>
</li>                   
</ul>
about 4 years ago · Juan Pablo Isaza
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