|
Answer» Hi. I've found lots of scripts for changing the background by time of day or randomly but not what I'm looking for.
What I need to do is have the background automatically change in a table cell after a week so that people can tell which ones are new and which ones are old. SEE: http://www.savejfc.net/videos.html
Each cell has a picture and a link to a video clip. I need the backgrounds to change so that returning visitors can find the new ones quickly.
I did find this script that will work for an image in a cell which I'm going to adapt to work for now but I really want to change the whole background of a cell... if not the image then at least the color:
//remember in javascript january is month 0 var firstday = new Date(2007, 06, 09); //start on Midnight 22 -0:00 var lastday = new Date(2007, 08, 09); //start on Midnight 23 -0:00 var today =new Date() today.getTime() if ((today>firstday) && (today < lastday)) { document.getElementById("cell1").src="image2.gif" }
MUCH thanks for your help!It looks like your site would be better fitted with php than just plain html. I can think of several easy WAYS to do what you're trying to do with php, but it might be more difficult with javascript. If you were using php, you could display all of the video files from a SPECIFIED folder and arrange them by date, and highlighting the new ones or changing the background color of old ones or whatever you want to do. If you need a tutorial on php, check out www.phpbuilder.net
|