Slideshow repeater colour background

Hi

I am currently working on a slideshow repeater , I have 3 items in the repeater . I want the background colour to change each time it slide, no matter what I try the same background colour applies to all 3 slides/items ?

-using wix studio.
-tried adding container within to change colour each slide , but the same colour applies to all slides/items

thanks

Could you show the code you’ve got so far, and maybe a small video showcasing the error?

1 Like

Hi, ryan_johnson1 !!

Do the colors need to change each time the slide changes, or is it sufficient if the three slides are already divided into three different colors from the beginning? :thinking:

※ If you just want to change the background color of the boxes within the repeater to be colorful, like this should probably work.

$w.onReady(function () {

 $w("#repeater1").forEachItem(($item, itemData, index) => {
         const backgroundColors = ["#FFCCCC", "#CCFFCC", "#CCCCFF"];
         $item("#repeaterBox").style.backgroundColor = backgroundColors[index];
 });

});
2 Likes

With a repeater, the colours will generally be the same across all items. I would probably try using a flexbox slider. Should be able to achieve the same repeater functions.

1 Like

thanks for the advice .