I'm working on this navbar that when bgColor is true it needs to change the background color to rgba(15,18,65,0.9).
But when bgColor isn't true the background color needs to change. This works but it's to quick so I thought to put a delay on it, but for some reason it won't return the string and change background color.
If I console log the color instead of returning it it works fine. So what am I misunderstanding here? It only needs to delay the false color option.
$(".navbar-dark")
.css("background-color", bgColor ? "rgba(15,18,65,0.9)" :
setTimeout(function(){return "rgba(15,18,65,0)";}, 1000)
);