JAVA SCRIPTING - incorparating time scheduling in a slide show
-
I'm a newbie at java script and have made a slideshow which randomizes which pics and so on. But now I want to display only certain sets of pics inbetween certain times e.g. between 06:00 am and 07:30 am set 1 then back to normal then 11:45 am and 12:50 pm set 2 and so on, and I'm having problems puting all this on a fullscreen with no scrollbars or anything just the pics. If anyone who reads this can help it would be greatly appreciated. Stay well and ejoy life to the max
-
I'm a newbie at java script and have made a slideshow which randomizes which pics and so on. But now I want to display only certain sets of pics inbetween certain times e.g. between 06:00 am and 07:30 am set 1 then back to normal then 11:45 am and 12:50 pm set 2 and so on, and I'm having problems puting all this on a fullscreen with no scrollbars or anything just the pics. If anyone who reads this can help it would be greatly appreciated. Stay well and ejoy life to the max
hi I dont know how u can check the system time, but... if u know how then u can do this: Set an interval using the 'setInterval' function to check the time every 1000 ms (=every second) or 60000 ms (= every minute). for example
var NumberOfPicsForEachSet=5;
var NumberOfSets = 3;
var use_set = 0;
// here we create the each set
var YourSetsOfPics= new Array(NumberOfSets);
YourSetsOfPics[0] = new Array(NumberOfPicsForEachSet);
YourSetsOfPics[1] = new Array(NumberOfPicsForEachSet);
YourSetsOfPics[2] = new Array(NumberOfPicsForEachSet);
//here we initialize each picture for each set
YourSetsOfPics[0][0] = "pic01.gif"
YourSetsOfPics[0][1] = "pic02.gif"
.
. // the first [] is for the set and the second [] is for the picture (I think)
.
YourSetsOfPics[3][2] = "pic08.gif"
YourSetsOfPics[3][3] = "pic09.gif"function CheckTime()
{
var the_time;
the_time = YourFunctionToGetTheTime();
use_set= 2; // use the 3rd set in the array
if ((the_time>"6:00") and (the_time<"7:30"))
use_set = 0; // use the 1st set in the array
if ((the_time>"11:45") and (the_time<"12:50"))
use_set = 1; // use the 2nd set in the array
}function OnDocLoad()
{
// check the time every second
<code> setInterval("CheckTime()",1000);</code>
}Hope I helped you... I m not sure you can use the [][] like I showed you. but if u can... good for you (I think it should work. =-=-=-=-=-=-= The Server :rose: