bfintal / Counter-Up

Counter-Up is a lightweight jQuery plugin that counts up to a targeted number when the number becomes visible.
http://bfintal.github.io/Counter-Up/demo/demo.html
GNU General Public License v2.0
746 stars 722 forks source link

Uncaught TypeError: Cannot read property 'replace' of undefined #63

Open ifourvimal opened 6 years ago

ifourvimal commented 6 years ago

While integrating counter up with my project I am getting this error on console

Uncaught TypeError: Cannot read property 'replace' of undefined
    at Waypoint.a [as callback] (jquery.counterup.min.js:9)
    at Waypoint.trigger (jquery.waypoints.min.js:59)
    at Group.flushTriggers (jquery.waypoints.min.js:531)
    at jquery.waypoints.min.js:438

Here is my html

<div class="value white">
    <p class="sbold addr-font-h1" ><span class="counter"> 1000 </span></p>
    <p>NEW Records</p>
</div>

here is jquery

<script type="text/javascript">
    $(document).ready(function() {
        $('.counter').counterUp();
    });
</script>

I ahve included script like below,

<!-- Counterup  -->
<script src="assets/vendor/counterup/jquery.waypoints.min.js"></script>
<script src="assets/vendor/counterup/jquery.counterup.min.js"></script>
dgumbo commented 5 years ago

hello i was getting the same error for a while, that was before i decided to use the min version and it started working.

For me 'jquery.counterup.js' does not work but 'jquery.counterup.min.js' works