If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.

I do indeed, there are four images in total and I would like the image to change every Sunday. The first week of each month I would like image 1 to show, the second week, image 2 to show, the third week image 3 and the fourth week image 4, then it would start at image 1 again.

That is based on the month, so that the first to the seventh of any month will be image1, all the way up to image five, from the 29th to 31st. For example, today and tomorrow are image2, the day after is image3.

Changing every week regularly is far more complicated.

Great wit and madness are near allied, and fine a line their bounds divide.

That is based on the month, so that the first to the seventh of any month will be image1, all the way up to image five, from the 29th to 31st. For example, today and tomorrow are image2, the day after is image3.

Changing every week regularly is far more complicated.

Thank's for getting back to me.

The only thing is, each image is a different part of a cleaning rota which will need to be scheduled to change on a particular day in the week.

Is it not possible for the image to change on the same day of each week?

The whole expression below generates 1 from Sat. to Fri., 2 the next Sat., 3 the Sat. after that, 4 the Sat. after that, and back to 1 then. Every seven days, it changes. If you want to speed it up a tiny little bit, multiply out 60000*60*24*7 and put in the actual value for it.

Code:

(Math.floor(((new Date()).getTime())/(60000*60*24*7)&#37;4)+1)

It's probably possible to get it to change on a day other than Saturday, for example, if you change the Math.floor, to Math.ceil, I think it'll change on a Sunday instead.

Great wit and madness are near allied, and fine a line their bounds divide.