Daily Style Sheets

Created - July, 2004 - bweir.com

Use ths script to call different style sheets for each day of the week. You will need 7 stylesheets, In this example, the naming convention is that you call the stylesheet 'styleN.css' where 'N' represents the day of the week, starting with 0 up to 6. (Javascript counts days starting with 0 for Sunday). The date is calculated from the local machine that is executing the code (e.g. the viewer).

In this example, I have a directory called 'styleBin' at the same level as this page.

Scroll to the bottom to see the color key for each day.

On this page, the style is applied here - in the <h3> tags.

here is the code:

   - this is the script that goes in the head of your document.
    note that it is not included in any function calls.
    if you have more scripting, make sure this is at the top.

var curdate = new Date()
var day = curdate.getDay()
setStyle = "style" + day + ".css";

document.writeln("<link href=\"styleBin/" + setStyle + "\" rel=\"stylesheet\" type=\"text/css\">");

Sun: Background - blue, Color - orange.
Mon: Background - red, Color - blue.
Tue: Background - orange, Color - black.
Wed: Background - purple, Color - white.
Thu: Background - black, Color - orange.
Fri: Background - yellow, Color - navy.
Sat: Background - lightsteelblue, Color - red.