My application showcases a list of images using ng-repeat
.
+---------------------------------------------+
| | Previous Image 0 | |
| +------------------------------------+ |
| +------------------------------------+ |
| | | |
| | Current Image 1 | |
| | | |
| +------------------------------------+ |
| +----------------------------------- + |
| | Next Image 2 | |
+---------------------------------------------+
The code to display this list is as follows:
<div ng-repeat="item in myImageArray">
<img ng-src="{{item.url}}" id="image{{item.id}}">
</div>
Goal:
In the list, I aim to set the opacity of Previous Image 0
and Next Image 2
to 50%
.
And the opacity of Current Image 1
to 100%
.
Essentially, only the visible image should have an opacity of 100%
, while others have an opacity of 50%
.