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

243
Vistas
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 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