>
> 2009/7/30 Brian Hazelton <bdh_2...@comcast.net>
>
>> Andzia wrote:
>> > Hello, I have this website almost finished:
>> > http://klikerlab.pl/
>> > and I had an idea, that maybe I could make it more active, by changing
>> the
>> > image to the left, each day. Can it be done with css? For example, that
>> the
>> > chicken would be displayed on Monday, something else on Tuesday, etc....
>> or
>> > should I use a different method?
>> >
>> > Thank you
>> > Ania
>> > ______________________________________________________________________
>> >
>>
>
>
>>
>> I would use server side scripting and not javascript, javascript can be
>> disabled by the end user and server side language would ensure more
>> compatibility.
>>
>
I forgot to add the list to the addressees...


I agree with Brian: it's better to use a server side script.
I used this solution for a client of mine that needed a different design on
second the seasons for a Wordpress template. I firstly created a script in
which the current season was detected (winter, summer, and so on). Then,
with a simple switch I established that the body tag class was set with the
name of the season. This way, the server side part created the markup with
the class depending on the season. The CSS part was to set styles depending
on the body class, such as:

.summer h1 {...}
.summer #header {...}

In your case it's simpler. You write an external PHP script to be included
in your WP template in which you decide to set a class to the <div> of the
image such as "tue", "wed", and so on. Then, in the style.css you set:

.mon {
    background: transparent url(img/monday.jpg) no-repeat top left;
}

.tue {
    background: transparent url(img/tuesday.jpg) no-repeat top left;
}

.wed {
    background: transparent url(img/wednesday.jpg) no-repeat top left;
}

...


Regards


-- 
~ Cristian Palmas ~
http://www.cristianpalmas.it

Chi vuole davvero realizzare i propri sogni, si sveglia all'alba

One who really wishes to realize his own dreams, wakes up at dawn
______________________________________________________________________
css-discuss [cs...@lists.css-discuss.org]
http://www.css-discuss.org/mailman/listinfo/css-d
List wiki/FAQ -- http://css-discuss.incutio.com/
List policies -- http://css-discuss.org/policies.html
Supported by evolt.org -- http://www.evolt.org/help_support_evolt/

Reply via email to