tags:

views:

27

answers:

2

I want to have some content on my page (some images) change based on the date. With jQuery, how would this be possible?

Basically, I am leaving on vacation and my client needs something to change while I'm unavailable.

I've been able to do it with ColdFusion for another client, but I don't know how to do it with jQuery. Any help is GREATLY appreciated.

A: 

Have a look here for Date object: http://www.w3schools.com/jsref/jsref_obj_date.asp

based on date just change/manipulate images

infinity
+2  A: 

Example, check if Date is after Christmas. The div_id needs to be set to display:none; initially. You can change the selector to an id, class, or whatever else you need.

var now = new Date();

var Christmas = new Date("December 25, 2010");

if(now > Christmas) // today is after Christmas
{
     // an id of a div that holds your images?
     $('#div_id').show();
     // or a class of images
     $('.imageClass').show();
}
Bryan Denny
Great 11 line tutorial. Thank you.
Ofeargall