October 15th is a little late in the season to begin Fall (official date of Fall is around September 20, some go for Labor Day as the the unofficial start of the Fall season).
So, I'm unclear as to what dates you really want to use for the other seasons, seeing as how you appear to have a rather unique view of when Fall begins.
But I'll let you worry about that, you can configure the months and dates as you see fit. This will just be an example of the code to use (place before your image array(s) in the same script):
Code:
;(function(){
var d = new Date(),
m = d.getMonth(),
dy = d.getDate();
if (m < 3 || m == 3 && dy < 20)
fadeshow.quarter = 'winter';
else if (m < 6 || m == 6 && dy < 21)
fadeshow.quarter = 'spring';
else if (m < 9 || m == 9 && dy < 15)
fadeshow.quarter = 'summer';
else if (m < 11 || m == 11 && dy < 21)
fadeshow.quarter = 'fall';
else fadeshow.quarter = 'winter';
})();
Remember, in javascript January is 0, not 1, so 3 would be April, 6 July, and so on.
OK, once you have that there are various things you can do. You could use folders, or just the filenames to rotate the image pools. For example:
Code:
var fadeimages=new Array()
//SET IMAGE PATHS. Extend or contract array as needed
fadeimages[0]=[fadeshow.quarter+"photo1.jpg", "", ""] //plain image syntax
fadeimages[1]=[fadeshow.quarter+"photo2.jpg", "http://www.cssdrive.com", ""] //image with link syntax
fadeimages[2]=[fadeshow.quarter+"photo3.jpg", "http://www.javascriptkit.com", "_new"] //image with link and target syntax
Will show (at this writing - 10/8):
summerphoto1.jpg
summerphoto2.jpg
summerphoto3.jpg
On the 15th of this month (October), they would change to:
fallphoto1.jpg
fallphoto2.jpg
fallphoto3.jpg
So to put it all together, you would have:
Code:
;(function(){
var d = new Date(),
m = d.getMonth(),
dy = d.getDate();
if (m < 3 || m == 3 && dy < 20)
fadeshow.quarter = 'winter';
else if (m < 6 || m == 6 && dy < 21)
fadeshow.quarter = 'spring';
else if (m < 9 || m == 9 && dy < 15)
fadeshow.quarter = 'summer';
else if (m < 11 || m == 11 && dy < 21)
fadeshow.quarter = 'fall';
else fadeshow.quarter = 'winter';
})();
var fadeimages=new Array()
//SET IMAGE PATHS. Extend or contract array as needed
fadeimages[0]=[fadeshow.quarter+"photo1.jpg", "", ""] //plain image syntax
fadeimages[1]=[fadeshow.quarter+"photo2.jpg", "http://www.cssdrive.com", ""] //image with link syntax
fadeimages[2]=[fadeshow.quarter+"photo3.jpg", "http://www.javascriptkit.com", "_new"] //image with link and target syntax
Bookmarks