Hi All!
I have an issue with below code. Second and third counters don’t work. Browser indicates that functions are not exportde.
// Dokumentacja Velo API: Introduction - Velo API Reference - Wix.com
$w(“#image11”).src = “https://static.wixstatic.com/media/” + $w(“#image11”).src.split(“/”)[3];
export function counterCustomers_viewportEnter(event) {
let startNum = 0;
const endNum = 150000;
const duration = 3000;
const range = endNum - startNum;
const interval = 500 // speed of the count in ms
const increment = range / (duration / 10); // Increment value for each 10ms
let currentNum = startNum;
const counterInterval = setInterval(() => {
currentNum += increment;
if (currentNum >= endNum) {
clearInterval(counterInterval);
currentNum = endNum;
}
$w('#counterCustomers').text = currentNum.toLocaleString();
}, 10); // Update the counter every 10ms
}
export function counterClaims_viewportEnter(event) {
let startNum = 0;
const endNum = 5000;
const duration = 3000;
const range = endNum - startNum;
const increment = range / (duration / 10); // Increment value for each 10ms
let currentNum = startNum;
const counterInterval = setInterval(() => {
currentNum += increment;
if (currentNum >= endNum) {
clearInterval(counterInterval);
currentNum = endNum;
}
$w('#counterClaims').text = currentNum.toLocaleString();
}, 10); // Update the counter every 10ms
}
export function counterAgents_viewportEnter(event) {
let startNum = 0;
const endNum = 10000;
const duration = 3000;
const range = endNum - startNum;
const increment = range / (duration / 10); // Increment value for each 10ms
let currentNum = startNum;
const counterInterval = setInterval(() => {
currentNum += increment;
if (currentNum >= endNum) {
clearInterval(counterInterval);
currentNum = endNum;
}
$w('#counterAgents').text = currentNum.toLocaleString();
}, 10); // Update the counter every 10ms
}