On my website i'm wanting the theme to change through different times throughout the year...
I understand this can be done manually with asp.net or javascript which link to different css files, however i'm wondering if there is way there a way so it will switch the styles automatically?
Thanks in advance,
Haydn
The two methods you described would be the automatic way. Opening the file and changing the CSS by hand would be the manual way.
I understand what your saying, but how could it switch the css file at certain dates in the year without me touching the file?
Any server side language can get the system date and determine which css file to load based on whatever periods of time you select. Javascript could also just as easily check the date on the client and pull the appropriate css file based on the date range you choose.
Thanks for your help so far,
Could you provide some kind of sample code just to give me an idea as i am quite new to this.
For example in PHP:
if(Date('n') > 9){ //between september and december //echo your CSS here } else if(Date('n') > 6){ //between june and september //echo your CSS here } else if(Date('n') > 3){ //between march and june //echo your CSS here } else { //between january and march //echo your CSS here }
I don't know how clear I can be since you haven't decided what language you wish to use to do it nor what the particulars are about your problem.
Ok,
I have a range of themes for different events in the year e.g. christmas, new year etc..
I want it to change on specific date, or series of specific days. e.g. 25th, 30th, 31st.
Could you write it in either javascript, asp or asp.net
Thanks
http://www.w3schools.com/jS/js_obj_date.asp
Check out the site above and take a stab at it yourself...you are free to use the format for the logic I gave you above.
Ok thanks,
I'll let you know of any problems i have.
I've had a crack at it and still cannot get my head round how to do it..
Could you write a sample code in whatever code you find it easiest to write it in, thanks
The code I posted above would work (with minor tweaks) for any C styled language (javascript, php, ASP.net, Java, etc). You just need to check for the specific dates first and get more general as you go along.
I get what you mean, but i currently have no experience of any C styled language. Do you know anyone who could help, or if you could do it yourself.