Join the Webstudio community

Updated 2 months ago

Get collection item index

At a glance

The community member is looking for a way to get the index of a collection item, as they are trying to hide an element on the last item in the collection. The comments indicate that there is an open issue on GitHub related to this, and that two potential workarounds have been suggested. The community member plans to use the :last-child pseudo-class as a solution, and mentions that index variables will be useful.

Useful resources
Hi ! It's there a way to get collection item index ?
data.targets.length > collection item.??
I try to hide element on collection last item.
Maybe there is an other way to do this…
Thanks for your help !
O
M
3 comments
just commented there 2 potential workarounds
Great. I will use pseudo class last child in that case. I’m sure index variables will be very useful. 💪
Add a reply
Sign up and join the conversation on Discord