Hei Everyone
I have website called digna in Wix, and i need help.
Me and the team are working on changing the design of the role models, if you can see the + sign next to the images of the role models. We want that when you press the + sign on one image, it should expand and information and a description of only that person will appear, and that all the other images should be hidden or phased out.
How can we do it, by code or integrations?
Thank you
Abdimaalik
Hi,
so if you are using the repeater, you can do the following:
-
Make the text you wish to expand collapsed on load (through it’s properties and events panel).
-
Add onItemReady function for the repeater.
-
Inside this function add the click event handler to the ‘+’ repeater item.
-
Expand the item text inside it.
Sample code:
$w("#myRepeater").onItemReady( ($item, itemData, index) => {
$item("#repeatedPlusBtn").onClick( (event) => {
$item("#repeatedText").expand();
})
});
The actual implementation should check if the item is collapsed and based on the result collapse/expand text. Or contain another button that will be shown instead of plus with the click event that will collapse text.