The previous message was too long, so I tried to shorten it. Basically there are problems with the function, at least what I think of the problem. The goal is when the volume or slider exceeds 50, the color turns red, and when it is less than 50, it turns green.
JavaScript:
function changeColor(sheet) {
document.getElementById("Green").setAttribute('href', sheet);
document.getElementById("Red").setAttribute('href', sheet);
if (mediaClip.volume < 0.5)
{
changeColor("styleSheets/Green.css");
}
else
{
changeColor("styleSheets/Red.css");
}
Html:
<input type="range" onchange="setVolume();changeColor()" id='volume1' min=0 max=1 step=0.01 value='1'/>
All reviews are welcome, it would be great if it worked by the end of the night. Please keep in mind that I am very new to coding, the simpler the better.
source
share