Topic awaiting preservation: Date based CSS change |
|
---|---|
Author | Thread |
Maniac (V) Mad Scientist From: Jacks raging bile duct.... |
posted 10-01-2004 22:09
I'm looking for a script that can read the clients PC date and present my site with different CSS styles only on saturdays. Anyone, here use anything like that currently? |
Lunatic (VI) Mad Scientist From: Massachusetts, USA |
posted 10-01-2004 22:27
If not too much has to change, the easiest way to do this might be to add a bit of javascript which detects the day of the week and, if it's saturday, adds the class "saturday" to the body element. Something like this (untested and probably flawed code): |
Paranoid (IV) Inmate From: France |
posted 10-01-2004 23:06
And if you want to load another CSS you can also do : code: <link rel="stylesheet" type="text/css" id="myCss" href="normal.css" /> Place that code in the HEAD. Alas, I think that on saturdays the normal.css will be loaded and replaced by the saturday.css. |
Bipolar (III) Inmate From: f(x) |
posted 10-01-2004 23:27
If you want to use PHP, you can try something this: (untested) code: <?
|
Lunatic (VI) Mad Scientist From: Massachusetts, USA |
posted 10-01-2004 23:32
If you want to split the CSS up into two files, and use either poi's or zavaboy's suggestions, it might be better to provide both style sheets, one as an "alternate" style sheet, and then simply change which one is the alternate. See http://www.alistapart.com/articles/alternate/ . |
Paranoid (IV) Inmate From: France |
posted 10-01-2004 23:40
zavaboy: I suppose Boudga asked a client side solution because his visitors are from various time zones, and especially another time zone than that of the server. |
Bipolar (III) Inmate From: f(x) |
posted 10-02-2004 00:18 |
Maniac (V) Mad Scientist From: Jacks raging bile duct.... |
posted 10-05-2004 14:35
Thank you all for your wonderful contributions! As time permits I will look at which solution is best for my case. Currently, I'm seeking to change my client's business www site on Saturdays to the colors of my clients favorite college football team. |