Topic: Alternating CSS templates (Page 1 of 1) Pages that link to <a href="https://ozoneasylum.com/backlink?for=11095" title="Pages that link to Topic: Alternating CSS templates (Page 1 of 1)" rel="nofollow" >Topic: Alternating CSS templates <span class="small">(Page 1 of 1)</span>\

 
genkidave
Nervous Wreck (II) Inmate

From: Japan
Insane since: Nov 2003

posted posted 11-06-2003 11:25

OK, here's an interesting situation and question that I hope someone can help me with.

I'm creating 4 different CSS templates based on the 4 seasons of the year (Spring, summer, Autumn, Winter).
Now, is there a script out there that will automatically set the Eg. Winter.css in motion on December 21st (which is the first day of winter) so I don't have to manually do it?

If anyone knows of a script or has one, please send me email or reply to this post!

Thanks a bunch!!

Genki Dave

Emperor
Maniac (V) Mad Scientist with Finglongers

From: Cell 53, East Wing
Insane since: Jul 2001

posted posted 11-06-2003 12:50

genkidave: Any preference on language? I'm not sure there is the exact script out there that you are looking for but I'm sure there are PHP and JavaScript code out there which would do things like, e.g. display a different background for different seasons (I know I have seen ones that provide a day and night colour scheme).

___________________
Emps

The Emperor dot org

genkidave
Nervous Wreck (II) Inmate

From: Japan
Insane since: Nov 2003

posted posted 11-06-2003 13:14

Well, I'm not too familiar with scripts because I'm just learning about web design now, but a few people have mentioned PHP and JavaScript, but I'm not sure which key words to use when searching. I'm used:

Alternating CSS files
Changin CSS files for seasons
Holliday CSS files

Nothing has shown up, and I don't know enough to write one myself...
Any suggestions?

Genki Dave

Skaarjj
Maniac (V) Mad Scientist

From: :morF
Insane since: May 2000

posted posted 11-06-2003 13:37

Javascript would probably be your go-er there, unless you want to dynamically generate your page each time it loads.

Emperor
Maniac (V) Mad Scientist with Finglongers

From: Cell 53, East Wing
Insane since: Jul 2001

posted posted 11-06-2003 14:15

genkidave: PHP is a server-side language and you'd have to check with your host to see if it is installed (it is popular though). All you'd need to do is use the date fucntions:
http://www.php.net/date

to check the date and then echo the correct CSS file into the CSS file link.

And es searching for this could be tricky indeed - I'll have a nose around.

Good places to look are HotScripts.com or www.zend.com/codex.php and for javaScript I always have a peek at JavaScript Kit.com as al these sources divide up their scripts into categories which makes it easier to find

___________________
Emps

The Emperor dot org

Emperor
Maniac (V) Mad Scientist with Finglongers

From: Cell 53, East Wing
Insane since: Jul 2001

posted posted 11-06-2003 14:21

This code uses JavaScript to display an image depending on the date:
http://www.htmlgoodies.com/JSBook/dateimage.html

you should be able to st variables for when the seasons begin and end and then use if/else to check the date against them and load the appropriate CSS.

[edit: Here is our relevant FAQ:

:FAQ: How do I change stylesheets dynamically?

as you can see there are many different ways - your best approach might just be the way it is done in the example above using document.write]

___________________
Emps

The Emperor dot org



Post Reply
 
Your User Name:
Your Password:
Login Options:
 
Your Text:
Loading...
Options:


« BackwardsOnwards »

Show Forum Drop Down Menu