I'm making a website on Wix and it has Velo which works like javascript (I don't understand much in coding)
I was trying to do a number counter which counts from 0 to a given number and I did it, but I need 4 different counters not sure how to do it maybe someone can help, please.
so my code looks like this
$w.onReady(function() {});
let startNum = 0;
let endNum = 145;
const duration = 20;
$w.onReady(function() {
setInterval(() => {
countUp();
}, duration);
});
function countUp() {
if (startNum <= endNum) {
$w('#StartNumber').text = startNum.toString();
startNum++;
}
}
#startnumber
is a text element that goes from 0 to 145
I want to do the same with 3 more elements #startnumber2
, 3, and 4.