Webmaster Forum

Go Back   Webmaster Forum > Webmaster Design/Layout Help Forum > CSS Forum
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

CSS Forum Get help from a webmaster in this forum regarding CSS.

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 02-02-2008, 04:32 PM
btb btb is offline
Junior Member
 
Join Date: Oct 2007
Posts: 4
btb is an unknown quantity at this point
Submit to Clesto Submit to Digg Submit to Reddit Submit to Furl Submit to Del.icio.us Submit to Jeqq Submit to Spurl
Default Change image on date

Hi

I have a header image on my site, but have 3 different styles - 1 for xmas, 1 for easter and another one to display at other times of the year!
What i'm wanting to know without having to either rename the header image file and upload or change the css file for those 3 times of the year, can css do this by itself at all?

Here is the code in the css:
#header {
background-image: url('site-header.jpg');
width: 800px;
height: 100px;
}


and here is the code in the php/html page:
<div id="header"></div>

and by going to enthusiasts guide to Brisbane Transport, you'll see what i mean, and for the header images, they are:
http://btbuses.info/site-header%20XMAS.jpg
http://btbuses.info/site-header%20EASTER.jpg
http://btbuses.info/site-header.jpg

Your suggestions are most welcomed. Thankyou...
Reply With Quote

This ad is part of our Revenue Sharing program
  #2 (permalink)  
Old 02-06-2008, 07:02 PM
ALL's Avatar
ALL ALL is offline
Senior Member
 
Join Date: Oct 2006
Location: Sturgis, SD
Posts: 145
ALL is on a distinguished road
Submit to Clesto Submit to Digg Submit to Reddit Submit to Furl Submit to Del.icio.us Submit to Jeqq Submit to Spurl
Default

what you could do is use javascript...

something like:

JavaScript Code:
document.onload = function (){ var header = document.getElementById('header'); var January = 0;var Febuary = 1;var March = 2;var April = 3;var May = 4;var June = 5;var July = 6;var August = 7;var September = 8;var October = 9;var November = 10;var December = 11; var date = new Date(); if(date.getMonth() == March && date.getDate() > 1 && date.getDate() < 15){ header.id = 'header_easter'; }else if(date.getMonth() == December && date.getDate() > 1 && date.getDate() < 31){ header.id = 'header_christmass'; } }
try something like that in your head, then in your css make an id called 'header_christmass' and 'header_easter' with the new background image in it, and it will change based on the user's internal computer's time.
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Date arithmetic muni1900 ASP & VBScript Forum 0 11-07-2007 07:23 PM
Example of Image Upload hanusoft Web Developers & Development Software 0 09-25-2007 09:37 AM
Simple Date Displayer missjojo HTML Forum 1 08-11-2007 03:47 AM
Change text encoding ANSI->UTF8 micky_tan13 ASP & VBScript Forum 1 07-28-2007 07:41 PM


All times are GMT. The time now is 03:30 AM.


Creative Commons License
Powered by vBulletin Version 3.6.2
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.0.0

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30