Feedback on: irt.org FAQ Knowledge Base Q236
Technical:
Not technical enough
Comments:
if you take out the " just before the word image, it works... then when you put it in a table, doesn't work at all either with the " or without...
Technical:
Not technical enough
Comments:
what would be the codes if the date instead of day was needed?
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;
}