Guest User

Untitled

a guest
Nov 22nd, 2017
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.85 KB | None | 0 0
  1. var time = 2000,
  2. counterStart = true;
  3. $(window).scroll(function () {
  4.  
  5. if (($(window).scrollTop() > 3760) && counterStart) {
  6. $('.anim-count').each(function(){
  7. var i = 1,
  8. istep = 1,
  9. num = $(this).data('num'),
  10. step = time / num,
  11. that = $(this),
  12. int;
  13. if (num.toString().length > 3)istep = 8;
  14. int = setInterval(function(){
  15. if (i <= num) {
  16. that.html(i);
  17. }
  18. else {
  19. clearInterval(int);
  20. that.html(num);
  21. }
  22. i+=istep;
  23. },step*istep);
  24. });
  25. counterStart = false;
  26. }
  27.  
  28. });
Add Comment
Please, Sign In to add comment