I am doing a social network type project and I need to make a change when a button in a custom collection is clicked, I saw some CSS resources that change the background of the cards collection according to the text of the button, I tried it but it does not work in the custom collection, can you help me?
In the first image a custom collection is displayed with its components, my idea is that when the “Highlight” button is pressed, it changes its text to “Do not highlight”.
The following image shows how the custom collection looks once the button is pressed, the changes are, the button text to “Do not highlight” and the display of a Meta Text is activated: Highlighted by Lic. Ejemplo.
If my understanding is correct, this is not a complicated case.
The key is your MetaText component. I assume you can control its visibility based on your button action.
If you only have one MetaText component, you can use the code below directly (without adding a custom-class).
But if you have multiple MetaText components, then replace .metaText with the custom class assigned to the specific MetaText component you are showing/hiding.
No, you cannot use the name igvxFI.
If you want to use your own class name, then assign your own arbitrary custom class in the component’s Options panel (on the right side of the builder) of that MetaText component—without using a dot.
The dot should only be used in the CSS code.
Also, I noticed that you added comments using //, which is incorrect. Remove them all, because they will cause the code below to stop working.
In CSS, comments must use /* comment */.