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

242
Views
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
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!