Vanilla 1.1.5a is a product of Lussumo. More Information: Documentation, Community Support.
1 to 6 of 6
Why not add in some PHP code or something to load a different stylesheet based on the time of day? It seems pretty simple...
Try this:
<head>
<?php
// Use the daytime stylesheet by default.
$stylesheet = 'daytime';
// Find the current hour.
$hour = (int)date('G');
// If it's night, use the nighttime stylesheet.
if ($hour < 6 || $hour >= 18) $stylesheet = 'nighttime';
?>
<link href="/stylesheets/<?php echo($stylesheet); ?>.css" media="screen" rel="stylesheet" type="text/css" />
</head>You could even extend this to have more than 2 distinct choices...
The only reason to do this in javascript is if you don't have a server-side language available. With javascript, you have to worry about browser issues, and you're relying on the user having javascript enabled. In morganp's example, if the user has javascript disabled, they won't get either stylesheet.
1 to 6 of 6