Skip to content

Tag: setinterval

switching between two colors is not working

What is it that I am missing here so my page switches between these two colors? Thank you ! Answer You’re never changing the value of isBlue, so it’s always false, so you always set white as the background color. Afrer the if/else, invert the flag: E.g.: Side note: “isBlue” seems an odd name for […]

countup and countdown loop

I want to count from 3 down to 0 then back up to 3 in a loop. This is kind of “slider” implementation. Everything runs fine until reach the clearInterval from counterry. What am I missing? var …