Function not working on all items of repeater?

I have a function (which is a counter animation to numbers) that I’m trying to pass on an element of every repeater item.
The function is working pretty well, however, for only the first item. So the animation will view properly for the element in the first item however it does not work for other items.
I have tried to use forItems but no use.
Repeater is connected to a dataset

$w("#text20").onViewportEnter( event => counterManager.add(event) );

Bump? Any help is appreciated.

For repeaters you need to use the context selector.
Check the doc about $.at()

Hello I tried doing this but it does not work anymore (not even for the first element)

export function repeater_view(event){
 let $item = $w.at(event.context);
    $item('#text20').onViewportEnter(counterManager.add(event));
}

Any other way to do this?

$w.onReady( function () {
$w( ‘#text20’ ).onViewportEnter(e => {
let $item=$w.at(e.context)
$item( “#text20” ).text = new Date().toISOString()
})
})

Register the event in the onReady()
When each item enters on the viewport, its text will change to current time.

Appreciate it! it worked!