Here is the current CSS code for the "firstTri" class:
.firstTri{
width: 0;
height: 0;
border-top: 160px solid transparent;
border-bottom: 160px solid transparent;
border-left: 160px solid gray;
}
I want to change the color of this triangle to yellow, so I have added the following code:
$('.firstTri').css("border-right","160px solid yellow");
Now, what if I want to update the color using values from an array?
samples = [
{
values : ["blue", "red", "green", "blue", "yellow"],
},
{
values : ["...etc"],
}
];
I was thinking of achieving this with a code snippet like the following:
$('.firstTri').css("border-right","160px solid samples[i].values[j]");
Where i and j would increment, with i incrementing after j reaches its limit.
For example, if we want to use the second index which is red, we would refer to it as:
samples[0].values[1]