Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function countUp(count)
- {
- var div_by = 100,
- speed = Math.round(count / div_by),
- $display = $('.count'),
- run_count = 1,
- int_speed = 24;
- var int = setInterval(function() {
- if(run_count < div_by){
- $display.text(speed * run_count);
- run_count++;
- } else if(parseInt($display.text()) < count) {
- var curr_count = parseInt($display.text()) + 1;
- $display.text(curr_count);
- } else {
- clearInterval(int);
- }
- }, int_speed);
- }
- countUp(<?php
- $sql="select count(id) total from users";
- $row=$mysqli->query($sql)->->fetch_assoc();
- //495
- echo $row['total'];
- ?>);
- function countUp2(count)
- {
- var div_by = 100,
- speed = Math.round(count / div_by),
- $display = $('.count2'),
- run_count = 1,
- int_speed = 24;
- var int = setInterval(function() {
- if(run_count < div_by){
- $display.text(speed * run_count);
- run_count++;
- } else if(parseInt($display.text()) < count) {
- var curr_count = parseInt($display.text()) + 1;
- $display.text(curr_count);
- } else {
- clearInterval(int);
- }
- }, int_speed);
- }
- countUp2(947);
- function countUp3(count)
- {
- var div_by = 100,
- speed = Math.round(count / div_by),
- $display = $('.count3'),
- run_count = 1,
- int_speed = 24;
- var int = setInterval(function() {
- if(run_count < div_by){
- $display.text(speed * run_count);
- run_count++;
- } else if(parseInt($display.text()) < count) {
- var curr_count = parseInt($display.text()) + 1;
- $display.text(curr_count);
- } else {
- clearInterval(int);
- }
- }, int_speed);
- }
- countUp3(328);
- function countUp4(count)
- {
- var div_by = 100,
- speed = Math.round(count / div_by),
- $display = $('.count4'),
- run_count = 1,
- int_speed = 24;
- var int = setInterval(function() {
- if(run_count < div_by){
- $display.text(speed * run_count);
- run_count++;
- } else if(parseInt($display.text()) < count) {
- var curr_count = parseInt($display.text()) + 1;
- $display.text(curr_count);
- } else {
- clearInterval(int);
- }
- }, int_speed);
- }
- countUp4(10328);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement