I need to use class="side1" from the custList because that is the side of the cube I want to flash a different color everytime a certain time passes. The only way I found that it works is if I use a setInterval but I don't want it to just keep changing colors every so many seconds. If the cube as been sitting there for 5min it will go from green to yellow and if it's been there for 7min it will go to red and stay red until it's done and then disappears. What can I do to make it work?
<div id="loader"></div>
<div style="display: none;" id="myDiv" class="animate-bottom">
<%--The routing cube--%>
<div id="wrapD3Cube" class="normal"></div>
</div>
var custList = "";
var top = 0;
var left = 0;
for (var i = 0; i < Data.length; i++) {
custList += '<div class="D3Cube" id="D3Cube"' + i + '>';
custList += '<div class="side1" id="side1' + i + '"
style="position:absolute; opacity: 1.05; width: 112px; height: 112px;">
</div > ';.
var changeColor = 0
function colors() {
if (changeColor < 4000) {
document.getElementsByClassName("side1").style.backgroundColor
= '#91CB8A';
}
else if (changeColor >= 5000) {
document.getElementsByClassName("side1").style.backgroundColor
= '#F7B448';
}
else if (changeColor >= 6000) {
document.getElementsByClassName("side1").style.backgroundColor
= '#E84F60';
}
}
colors();