[Need Help T^T] How to give images in repeater a unique ID?

So at the top of the page you should also have this
$w.onReady(function()=>{
accessElements()
})

okay thanks alot, I will try now :smiley:

Oke let me know if it works or not :slight_smile:

It shows unexpected token on the “=>”

Yea remove it, seemslike it isn’t needed there :sweat_smile:
Not at a computer atm so hard to remember evrything :sweat_smile:

So sorry to bother you :sweat_smile::sweat_smile:

I have another question which is can I use an art vector instead of a button? Or it doesn’t really matter?

No problem i’m happy to help :slight_smile:

Make a button transparant, add the artvector behimd it and make them am Element group.
U still use the buttok but the vectornis shown xd

This is my code but it still doesn’t work T.T

@volkaertskristof ahhh make sense!:joy:

You did it wrong xd
You hold the code you had before. But the code i sended you add at the top of the code panel

So how should I actually do it haha. Im really noob at this

So the code will be something like this:

$w.onReady(function() {
accessElements()
})

Function accessElements(){
All the code from before
}

it still doesn’t work
I have no idea whyyyyyy

Send the code again that you have now, but copy paste it not a screenshot :slight_smile:

$w.onReady( function (){
accessElements
})

function accessElements(){
$w( “#repeater1” ).forEachItem(($item,itemData,index) =>{
const button = $item( “#button8” )
button.onClick((event) => {
if ($item( “#image1” ).collapsed()) {
$item( “#image1” ).expand()
} else {
$item( “#image1” ).collapse()
}
})
})
}

You forgot () after accessElements in the $w.onReady code

OMGGGG it finally works!!!

Thank you sm!!!