1
0
mirror of https://github.com/tabler/tabler.git synced 2025-12-22 01:44:25 +04:00

Enable scrollSpy in countup module (#2113)

Co-authored-by: Paweł Kuna <1282324+codecalm@users.noreply.github.com>
This commit is contained in:
carlosmintfan
2025-02-01 17:01:29 -03:00
committed by GitHub
parent 28131f42df
commit d3ae77cf8b
2 changed files with 9 additions and 2 deletions

View File

@@ -0,0 +1,5 @@
---
"@tabler/core": patch
---
Enable `scrollSpy` in `countup` module

View File

@@ -4,7 +4,9 @@ if (elements.length) {
elements.forEach(function (element) { elements.forEach(function (element) {
let options = {}; let options = {};
try { try {
options = element.getAttribute('data-countup') ? JSON.parse(element.getAttribute('data-countup')) : {}; const dataOptions = element.getAttribute('data-countup') ? JSON.parse(element.getAttribute('data-countup')) : {};
options = Object.assign({'enableScrollSpy': true}, dataOptions);
} catch (error) {} } catch (error) {}
const value = parseInt(element.innerHTML, 10); const value = parseInt(element.innerHTML, 10);