What i need is a javascript countdown clock that will start everyday at 7:40am and end at 2:15pm. But when it ends at 2:15pm i need it to auto restart at 7:40 am.
Asked
Active
Viewed 1,219 times
-1
-
Can you ask a more specific question instead of asking for the entire thing to be written for you? – Jarrett Widman Apr 15 '11 at 02:49
-
1awesome, have fun writing your program! – jberg Apr 15 '11 at 02:50
-
"auto restart". You mean if you have a page opened for a full day it does that automatically? – Khez Apr 15 '11 at 02:58
-
No i cant ask for a more specific question because i do not know how to code in jscript. – ryan Apr 15 '11 at 03:27
-
Here's some pseudocode: `var countdownClock = function() { /* implementation goes here */ }; countdownClock();` – Eli Apr 15 '11 at 03:39
-
*No i cant ask for a more specific question because i do not know how to code in jscript.* Then hire someone who can. – KooiInc Apr 15 '11 at 04:39
1 Answers
0
<script type="text/javascript" src="jquery.js"></script>
// 6 hours and 45 minutes
iMilliseconds = 6 * 60 * 60 * 1000 + 45 * 60 * 1000;
function Restart()
{
Start();
setTimeout(iMilliseconds, Restart);
}
function Start()
{
// Do things
}
$(document).ready(function()
{
Restart();
});

Daniel Protopopov
- 6,778
- 3
- 23
- 39