Log in

View Full Version : I need a script to show differnt content at different times of the day.



dannyboyoh
03-03-2008, 10:54 PM
I want to have a slide show of images on a page that changes the pictures in the show at different times of the day.

Say at 7am-3pm show
Image1.jpg
Image2.gif
Image3.jpg

at 3pm-11pm show
Image4.gif
Image5.jpg
Image6.jpg

and at 11pm-7am show
Image7.jpg
Image8.jpg
Image9.gif

Jas
03-04-2008, 03:28 AM
In this slide show (http://www.dynamicdrive.com/dynamicindex14/translucentslide.htm), for example, replace this:


slideshowcontent[0]=["photo1.jpg", "http://www.cnn.com", "_new"]
slideshowcontent[1]=["photo2.jpg", "", ""]
slideshowcontent[2]=["photo3.jpg", "http://www.google.com", ""]
with something like:


var d = new Date();
if(d.getHours() < 10){
slideshowcontent[0]=["1.jpg", "", ""]
slideshowcontent[1]=["2.jpg", "", ""]
slideshowcontent[2]=["3.jpg", "", ""]
}else if(d.getHours() < 18){
slideshowcontent[0]=["3.jpg", "", ""]
slideshowcontent[1]=["4.jpg", "", ""]
slideshowcontent[2]=["5.jpg", "", ""]
}else{
slideshowcontent[0]=["6.jpg", "", ""]
slideshowcontent[1]=["7.jpg", "", ""]
slideshowcontent[2]=["8.jpg", "", ""]
}