Home Articles FAQs XREF Games Software Instant Books BBS About FOLDOC RFCs Feedback Sitemap
irt.Org

Feedback on: irt.org FAQ Knowledge Base Q236, Saturday July 28, 2007 at 10:43:06

You are here: irt.org | About | Feedback | 4851 [ previous next ]

Feedback on:
irt.org FAQ Knowledge Base Q236

Sent by
CP on Saturday July 28, 2007 at 10:43:06

Worth:

Length:

Technical:

Comments:
Try this - crude but effective. You can create a variable for your number of images, in this case 9.

var today = new Date();
var startdate = new Date();
startdate.setTime(1183894600000);
//nine pictures roll over every day in milliseconds
var daysInMs = today - startdate;
var day = (Math.round(daysInMs/86400000)% 9) + 1;// divisor is number of milliseconds in a day
var feature;
var pix = new Array();
feature = "jpeg/medium/" + day + ".jpg";;
var startLargepath = "jpeg/large/";
var endLargepath = ".html";
function updateImages()
{if (day == 9)
{pix[2] = 1;
pix[3] = 2;
pix[4] = 3;
}
else if (day == 8)
{pix[3] = 1;
pix[4] = 2;
pix[2] = (day + 1)
}
else if (day == 7)
{pix[4] = 1;
pix[3] = day + 2;
pix[2] = day + 1;
}
else for (var i = 2; i < 5; i++)
pix[i] = day + i-1;
}





Other feedback on 'irt.org FAQ Knowledge Base Q236' - show all

©2018 Martin Webb