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:
5
.changeset/famous-items-tap.md
Normal file
5
.changeset/famous-items-tap.md
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
---
|
||||||
|
"@tabler/core": patch
|
||||||
|
---
|
||||||
|
|
||||||
|
Enable `scrollSpy` in `countup` module
|
||||||
@@ -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);
|
||||||
|
|||||||
Reference in New Issue
Block a user