I worked for several hours, but I canβt understand why setting the z-index does not affect the circles in real time.
Javascript / Jquery:
var greenCircle = "#greenCircle";
var blackCircle = "#blackCircle";
$(greenCircle).css("z-index", "5");
$(blackCircle).css("z-index", "4");
$(greenCircle).animate({ width: '200%', height: '100%', left: '-50%', top: 0}, lockTime);
Here is the HTML layout:
<img class = "clearCircle" id = "greenCircle" src = "Resources/Background/GreenCircle.png" alt = "Clear circle">
<img class = "clearCircle" id = "blackCircle" src = "Resources/Background/BlackCircle.png" alt = "Clear circle">
Inital CSS
.clearCircle {
position: absolute;
height: 0;
width: 0;
}
No matter what I tried, blackCircle is always ahead, and the code does not cause errors.
Thank you in advance for your help.
source
share