Home Articles FAQs XREF Games Software Instant Books About Feedback Search Site-Map
irt.org logo

Feedback on: irt.org FAQ Knowledge Base Q236

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


Provide feedback ...
AddThis Social Bookmark Button

Provide feedback ... AddThis Social Bookmark Button


Last Updated: 21st December 2007. Maintained by: Martin Webb
irt.org liability, trademark, document use, privacy statement and software licensing rules apply.
Copyright © 1996-2008 irt.org, All Rights Reserved.