1
0
mirror of https://github.com/tabler/tabler.git synced 2025-12-21 17:34:25 +04:00

countup added

This commit is contained in:
Dawid Harat
2019-12-28 23:13:00 +01:00
parent 94519737f4
commit 145edab513
6 changed files with 175 additions and 1 deletions

View File

@@ -1,3 +1,5 @@
import { CountUp } from "countup.js";
const tabler = {
hexToRgbA: function(hex, opacity) {
let c;
@@ -59,6 +61,19 @@ $(document).ready(function() {
// $('[data-toggle="tooltip"]').tooltip();
// $('[data-toggle="popover"]').popover();
/*
CountUp
*/
let countups = document.querySelectorAll("[data-countup]");
for(let i = 0;i<countups.length;i++){
let dataCountUp;
if(countups[i].getAttribute("data-countup") != ''){
dataCountUp = JSON.parse(countups[i].getAttribute("data-countup"));
}
let countup = new CountUp(countups[i],parseFloat(countups[i].innerText),dataCountUp);
countup.start();
}
/*
Imask plugin
*/