Answer the question
In order to leave comments, you need to log in
How to load different css relative to time of day?
Wrote something like this. Changes the styles of objects over time.
<script>var d = new Date();
var time = d.getHours();
if ( time > 18) {
document.getElementById('section1').style.backgroundImage = "url('img/bg2.jpg')";
document.getElementById('utm_title').style.color = "#fff";
document.getElementById('utm_desc').style.color = "#fff";
}
</script>
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question