Website Color Changer

[Total: 0    Average: 0/5]

This script changes the colors of your website at specific times of the day which you set.

Head Code:

<script>
var today = new Date(); 
var time = today.getHours();
var file = "/data/ex_920/style1.css";
if( time <= "14" ) file = "/data/ex_920/style2.css";
if( time <= "19" ) file = "/data/ex_920/style3.css";
if( time <= "23" ) file = "/data/ex_920/style4.css";
document.write("<link rel='StyleSheet' href="+file+" type='text/css'>");
</script>

Body Code:

This example will not do anything here on this website because there are no style sheets set up for this example.
This example only shows how to set up the javascript.
<BR />
<script>
document.write("File choosen was: "+file);
</script>

Times Viewed: 0

Leave a Reply

Your email address will not be published. Required fields are marked *