-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathscript.js
More file actions
38 lines (34 loc) · 953 Bytes
/
script.js
File metadata and controls
38 lines (34 loc) · 953 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
$(document).ready(function () {
$('.owl-carousel').owlCarousel({
loop: true,
items: 2,
margin: 20,
autoplay: true,
autoplayTimeout: 3000,
responsive: {
0: {
items: 1
},
990: {
items: 2
},
}
});
});
// Number counting animation
let valueDisplays = document.querySelectorAll(".countdown")
let interval = 8000
valueDisplays.forEach((display) => {
let startValue = 0;
let endValue = parseFloat(display.getAttribute("data-val"));
endValue = Math.round(endValue)
let duration = Math.floor(interval / endValue);
// Start the countdown animation from 0 to the given value
let counter = setInterval(function () {
startValue += 1;
display.textContent = `${startValue}+`;
if (startValue == endValue) {
clearInterval(counter);
}
}, duration)
})