Return to Snippet

Revision: 32891
at October 4, 2010 10:52 by lucian


Initial Code
<link rel="stylesheet" type="text/css" media="screen, projection" href="screen.css" />
<script type="text/javascript">
<!--
var d = new Date();
var sunrise = 6; // 6 AM
var sunset = 18; // 6 PM        
var currentHour = parseInt(d.getHours());
if(currentHour >= sunset || currentHour <= sunrise){
document.write('<link rel="stylesheet" href="dark.css" media="screen, projection" /' + '>');
}
// -->
</script>

Initial URL

                                

Initial Description
Use this in the `<head>` of your HTML files.

Initial Title
Change CSS based on time of the day

Initial Tags

                                

Initial Language
JavaScript