...

View Full Version : 10 Minute Clock



bailyesboy
01-29-2006, 10:03 PM
Has anyone got a script where an image (image 1) is on the screen at 12:00 and then 10 minutes later (12:10) image 2 comes up.

I need a script where the image changes every 10 minutes depending on the time.

Thanks
Simon

Lerura
01-29-2006, 10:24 PM
can image2 be a random picture or must it follow a specified order??

bailyesboy
01-30-2006, 04:54 PM
can image2 be a random picture or must it follow a specified order??

Specified order.

Lerura
01-30-2006, 07:27 PM
i guess this is what you want:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
<link rel="stylesheet" type="text/css" href="stylesheet.css" />
<style type="text/css"><!--

--></style>
<script type="text/javascript" src="javascript.js"></script>
<script type="text/javascript"><!--

SwapImageID='Something'; // ID of image to swap
SwapImage=new Array();
SwapImage[0]='xx00.gif'; // shown from xx:00 to xx:10
SwapImage[1]='xx10.gif'; // -||- xx:10 to xx:20
SwapImage[2]='xx20.gif'; // -||- xx:20 to xx:30
SwapImage[3]='xx30.gif'; // -||- xx:30 to xx:40
SwapImage[4]='xx40.gif'; // -||- xx:40 to xx:50
SwapImage[5]='xx50.gif'; // -||- xx:50 to xx:00

function Swap(){
x=new Date();
M=x.getMinutes();
Q=(M-(M%10))/10;
document.getElementById(SwapImageID).src=SwapImage[Q];
NextSwap=600000-x%600000;
setTimeout('Swap()',NextSwap);
}
// --></script>
</head>
<body onload="Swap()">
<img id="Something" />
</body>
</html>

bailyesboy
01-30-2006, 07:49 PM
i guess this is what you want:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
<link rel="stylesheet" type="text/css" href="stylesheet.css" />
<style type="text/css"><!--

--></style>
<script type="text/javascript" src="javascript.js"></script>
<script type="text/javascript"><!--

SwapImageID='Something'; // ID of image to swap
SwapImage=new Array();
SwapImage[0]='xx00.gif'; // shown from xx:00 to xx:10
SwapImage[1]='xx10.gif'; // -||- xx:10 to xx:20
SwapImage[2]='xx20.gif'; // -||- xx:20 to xx:30
SwapImage[3]='xx30.gif'; // -||- xx:30 to xx:40
SwapImage[4]='xx40.gif'; // -||- xx:40 to xx:50
SwapImage[5]='xx50.gif'; // -||- xx:50 to xx:00

function Swap(){
x=new Date();
M=x.getMinutes();
Q=(M-(M%10))/10;
document.getElementById(SwapImageID).src=SwapImage[Q];
NextSwap=600000-x%600000;
setTimeout('Swap()',NextSwap);
}
// --></script>
</head>
<body onload="Swap()">
<img id="Something" />
</body>
</html>


Good script but i need it to last 1 week (10,080 mins) and I need a link on the pics.

Thanks
Simon

Lerura
01-30-2006, 09:11 PM
... and if each picture should only be shown once per week, it will become 1008 different pics in a week.

if so the script will be HUGE since every combination of picture and link must be stored in an array. (i guess it will be 80k or more)

if i should be able to help you further i need to know more about the looping sequence



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum