Hello,
I would like the numbers to scroll when visitors arrive at the band in question.
Here is the code I made. It doesn’t work because I can’t use the onViewportEnter().
Could you please help me?
Thank you in advance.
$w.onReady(function () {
setInterval(()=> {
countUp();
}, duration);
setInterval(()=> {
countUp1();
}, duration1);
setInterval(()=> {
countUp2();
}, duration2);
setInterval(()=> {
countUp3();
}, duration3);
testFunction()
});
function testFunction(){
$w("#columnStrip2").onViewportEnter(e => {
console.log("Column entered the Viewport")
})
}
let startNum = 0;
let endNum = 1993;
const duration = 0.1;
function countUp(){
if (startNum <= endNum ){
$w('#text5').text = startNum.toString();
startNum++;
}
}
let startNum1 = 0;
let endNum1 = 54;
const duration1 = 100;
function countUp1(){
if (startNum1 <= endNum1 ){
$w('#tempCompNickName1624177632824').text = startNum1.toString();
startNum1++;
}
}
let startNum2 = 0;
let endNum2 = 25;
const duration2 = 120;
function countUp2(){
if (startNum2 <= endNum2 ){
$w('#tempCompNickName1624177649120').text = startNum2.toString();
startNum2++;
}
}
let startNum3 = 0;
let endNum3 = 2;
const duration3 = 140;
function countUp3(){
if (startNum3 <= endNum3 ){
$w('#tempCompNickName1624177655853').text = startNum3.toString();
startNum3++;
}
}