Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var time = 2000,
- counterStart = true;
- $(window).scroll(function () {
- if (($(window).scrollTop() > 3760) && counterStart) {
- $('.anim-count').each(function(){
- var i = 1,
- istep = 1,
- num = $(this).data('num'),
- step = time / num,
- that = $(this),
- int;
- if (num.toString().length > 3)istep = 8;
- int = setInterval(function(){
- if (i <= num) {
- that.html(i);
- }
- else {
- clearInterval(int);
- that.html(num);
- }
- i+=istep;
- },step*istep);
- });
- counterStart = false;
- }
- });
Add Comment
Please, Sign In to add comment