Change Z-Index Dynamically

Box 1 (Z: 1)
Box 2 (Z: 2)
Box 3 (Z: 3)

Adjust Z-Index: