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

feat: enhance documentation examples with improved layout and additional parameters for clarity

This commit is contained in:
codecalm
2025-04-19 20:40:43 +02:00
parent a037e8e429
commit 7295678c34
10 changed files with 56 additions and 135 deletions

View File

@@ -5,15 +5,19 @@ if (elements.length) {
let options = {};
try {
const dataOptions = element.getAttribute('data-countup') ? JSON.parse(element.getAttribute('data-countup')) : {};
options = Object.assign({'enableScrollSpy': true}, dataOptions);
options = Object.assign({
'enableScrollSpy': true
}, dataOptions);
} catch (error) {}
const value = parseInt(element.innerHTML, 10);
const countUp = new window.countUp.CountUp(element, value, options);
if (!countUp.error) {
countUp.start();
if (window.countUp && window.countUp.CountUp) {
const countUp = new window.countUp.CountUp(element, value, options);
if (!countUp.error) {
countUp.start();
}
}
});
}