So at the top of the page you should also have this
$w.onReady(function()=>{
accessElements()
})
okay thanks alot, I will try now ![]()
Oke let me know if it works or not ![]()
It shows unexpected token on the “=>”
Yea remove it, seemslike it isn’t needed there ![]()
Not at a computer atm so hard to remember evrything ![]()
So sorry to bother you ![]()
![]()
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 ![]()
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
@volkaertskristof ahhh make sense!![]()
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 ![]()
$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!!!
