File: /mnt/data/smarthr-co-in/demo/codeigniter_bk/template/public/assets/js/counter.js
/*
Author : Dreamstechnologies
Template Name: Smarthr - Bootstrap Admin Template
*/
(function () {
"use strict";
// Counter
if($('.counter').length > 0) {
$('.counter').counterUp({
delay: 20,
time: 2000
});
}
if($('#timer-countdown').length > 0) {
$( '#timer-countdown' ).countdown( {
from: 180, // 3 minutes (3*60)
to: 0, // stop at zero
movingUnit: 1000, // 1000 for 1 second increment/decrements
timerEnd: undefined,
outputPattern: '$day Day $hour : $minute : $second',
autostart: true
});
}
if($('#timer-countup').length > 0) {
$( '#timer-countup' ).countdown( {
from: 0,
to: 180
});
}
if($('#timer-countinbetween').length > 0) {
$( '#timer-countinbetween' ).countdown( {
from: 30,
to: 20
});
}
if($('#timer-countercallback').length > 0) {
$( '#timer-countercallback' ).countdown( {
from: 10,
to: 0,
timerEnd: function() {
this.css( { 'text-decoration':'line-through' } ).animate( { 'opacity':.5 }, 500 );
}
});
}
if($('#timer-outputpattern').length > 0) {
$( '#timer-outputpattern' ).countdown( {
outputPattern: '$day Days $hour Hour $minute Min $second Sec..',
from: 60 * 60 * 24 * 3
});
}
$('.counters').each(function() {
var $this = $(this),
countTo = $this.attr('data-count');
$({ countNum: $this.text()}).animate({
countNum: countTo
},
{
duration: 2000,
easing:'linear',
step: function() {
$this.text(Math.floor(this.countNum));
},
complete: function() {
$this.text(this.countNum);
}
});
});
})();