Advertisement
salmancreation

counterUp code js

Jan 9th, 2020
195
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.      // CouterUp
  2.     $('.price span').each(function () {
  3.        var size = $(this).text().split(".")[1] ? $(this).text().split(".")[1].length : 0;
  4.        $(this).prop('Counter', 0).animate({
  5.           Counter: $(this).text()
  6.        }, {
  7.           duration: 3000,
  8.           step: function (func) {
  9.              $(this).text(parseFloat(func).toFixed(size));
  10.           }
  11.        });
  12.     });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement