Danny696 Posted July 23, 2009 Share Posted July 23, 2009 I Need A Simple JS CountDown Clock That Counts Down To Every Hour? Is This Possible Ive Googles It But Only Found Ones For A Set Date & Time. Quote Link to comment Share on other sites More sharing options...
Danny696 Posted July 27, 2009 Author Share Posted July 27, 2009 Re: Count Down Clock Bump as i need it Quote Link to comment Share on other sites More sharing options...
CrazyT Posted July 28, 2009 Share Posted July 28, 2009 Re: Count Down Clock I guess you haven't used GOOGLE... i just looked and found loads.. and no i aint posting.. you can do it your self :D Quote Link to comment Share on other sites More sharing options...
shrek1609 Posted July 28, 2009 Share Posted July 28, 2009 Re: Count Down Clock crazy i think what he means he wants one where you can set the time at say 4 hours and it will count down... which is what i have searched for and can't find... the ones on google seem to be where you enter a date and it counts down to that Quote Link to comment Share on other sites More sharing options...
Mufasa Posted July 28, 2009 Share Posted July 28, 2009 Re: Count Down Clock Should be fairly easy to modify one. Instead of it counting to a set date in the future (measured in seconds) have it count towards a set amount of seconds ( 4 hours = 14400 seconds) Quote Link to comment Share on other sites More sharing options...
Faz` Posted July 28, 2009 Share Posted July 28, 2009 Re: Count Down Clock A quick google and this is what I found <script language="JavaScript"> TargetDate = "12/31/2020 5:00 AM"; BackColor = "palegreen"; ForeColor = "navy"; CountActive = true; CountStepper = -1; LeadingZero = true; DisplayFormat = "%%D%% Days, %%H%% Hours, %%M%% Minutes, %%S%% Seconds."; FinishMessage = "It is finally here!"; </script> <script language="JavaScript" src="http://scripts.hashemian.com/js/countdown.js"></script> I have no knowledge of javascript whatsoever, but I think even I could edit this to suit my needs. Quote Link to comment Share on other sites More sharing options...
shrek1609 Posted July 28, 2009 Share Posted July 28, 2009 Re: Count Down Clock A quick google and this is what I found <script language="JavaScript"> TargetDate = "12/31/2020 5:00 AM"; BackColor = "palegreen"; ForeColor = "navy"; CountActive = true; CountStepper = -1; LeadingZero = true; DisplayFormat = "%%D%% Days, %%H%% Hours, %%M%% Minutes, %%S%% Seconds."; FinishMessage = "It is finally here!"; </script> <script language="JavaScript" src="http://scripts.hashemian.com/js/countdown.js"></script> I have no knowledge of javascript whatsoever, but I think even I could edit this to suit my needs. correct me if i am wrong but the requires a countdown.js which will be the main workings of the script which you have no access to... Quote Link to comment Share on other sites More sharing options...
shrek1609 Posted July 28, 2009 Share Posted July 28, 2009 Re: Count Down Clock i think this is what you want... <!-- THREE STEPS TO INSTALL NUMBER COUNTDOWN: 1. Copy the coding into the HEAD of your HTML document 2. Add the onLoad event handler into the BODY tag 3. Put the last coding into the BODY of your HTML document --> <HEAD> <SCRIPT LANGUAGE="JavaScript"> <!-- Begin <!-- var g_iCount = new Number(); // CHANGE THE COUNTDOWN NUMBER HERE - ADD ONE TO IT // var g_iCount = 11; function startCountdown(){ if((g_iCount - 1) >= 0){ g_iCount = g_iCount - 1; numberCountdown.innerText = '00:00.0' + g_iCount; setTimeout('startCountdown()',1000); } } // End --> </script> </HEAD> <BODY onLoad="startCountdown()"> <font face="Digital Readout Upright" color="blue" size="7"> <div align="center" id="numberCountdown"></div> </font> <center> <font face="arial, helvetica" size"-2">Free JavaScripts provided by [url="http://javascriptsource.com"]The JavaScript Source[/url]</font> </center> thanks to http://javascriptsource.com Quote Link to comment Share on other sites More sharing options...
Danny696 Posted July 28, 2009 Author Share Posted July 28, 2009 Re: Count Down Clock Let me explain what i need; It needs to countdown to every 45 mins and thats 2700 seconds and it needs to be in a page with other coding not the header. Thanks danny696 Quote Link to comment Share on other sites More sharing options...
Dayo Posted August 9, 2009 Share Posted August 9, 2009 Re: Count Down Clock A quick google and this is what I found <script language="JavaScript"> TargetDate = "12/31/2020 5:00 AM"; BackColor = "palegreen"; ForeColor = "navy"; CountActive = true; CountStepper = -1; LeadingZero = true; DisplayFormat = "%%D%% Days, %%H%% Hours, %%M%% Minutes, %%S%% Seconds."; FinishMessage = "It is finally here!"; </script> <script language="JavaScript" src="http://scripts.hashemian.com/js/countdown.js"></script> I have no knowledge of javascript whatsoever, but I think even I could edit this to suit my needs. correct me if i am wrong but the requires a countdown.js which will be the main workings of the script which you have no access to... /* Author: Robert Hashemian [url]http://www.hashemian.com/[/url] You can use this code in any manner so long as the author's name, Web address and this disclaimer is kept intact. ******************************************************** Usage Sample: <script language="JavaScript"> TargetDate = "12/31/2020 5:00 AM"; BackColor = "palegreen"; ForeColor = "navy"; CountActive = true; CountStepper = -1; LeadingZero = true; DisplayFormat = "%%D%% Days, %%H%% Hours, %%M%% Minutes, %%S%% Seconds."; FinishMessage = "It is finally here!"; </script> <script language="JavaScript" src="http://scripts.hashemian.com/js/countdown.js"></script> */ function calcage(secs, num1, num2) { s = ((Math.floor(secs/num1))%num2).toString(); if (LeadingZero && s.length < 2) s = "0" + s; return "[b]" + s + "[/b]"; } function CountBack(secs) { if (secs < 0) { document.getElementById("cntdwn").innerHTML = FinishMessage; return; } DisplayStr = DisplayFormat.replace(/%%D%%/g, calcage(secs,86400,100000)); DisplayStr = DisplayStr.replace(/%%H%%/g, calcage(secs,3600,24)); DisplayStr = DisplayStr.replace(/%%M%%/g, calcage(secs,60,60)); DisplayStr = DisplayStr.replace(/%%S%%/g, calcage(secs,1,60)); document.getElementById("cntdwn").innerHTML = DisplayStr; if (CountActive) setTimeout("CountBack(" + (secs+CountStepper) + ")", SetTimeOutPeriod); } function putspan(backcolor, forecolor) { document.write("<span id='cntdwn' style='background-color:" + backcolor + "; color:" + forecolor + "'></span>"); } if (typeof(BackColor)=="undefined") BackColor = "white"; if (typeof(ForeColor)=="undefined") ForeColor= "black"; if (typeof(TargetDate)=="undefined") TargetDate = "12/31/2020 5:00 AM"; if (typeof(DisplayFormat)=="undefined") DisplayFormat = "%%D%% Days, %%H%% Hours, %%M%% Minutes, %%S%% Seconds."; if (typeof(CountActive)=="undefined") CountActive = true; if (typeof(FinishMessage)=="undefined") FinishMessage = ""; if (typeof(CountStepper)!="number") CountStepper = -1; if (typeof(LeadingZero)=="undefined") LeadingZero = true; CountStepper = Math.ceil(CountStepper); if (CountStepper == 0) CountActive = false; var SetTimeOutPeriod = (Math.abs(CountStepper)-1)*1000 + 990; putspan(BackColor, ForeColor); var dthen = new Date(TargetDate); var dnow = new Date(); if(CountStepper>0) ddiff = new Date(dnow-dthen); else ddiff = new Date(dthen-dnow); gsecs = Math.floor(ddiff.valueOf()/1000); CountBack(gsecs); Quote Link to comment Share on other sites More sharing options...
shrek1609 Posted August 9, 2009 Share Posted August 9, 2009 Re: Count Down Clock do a search in game modifications for the java hospital countdown i posted... that is what you need you will just have to alter it to what you want... dayo thats not what he's after that is where you set a date and it counts down to that... he wants it where you can set x amount of minutes and it will count down Quote Link to comment Share on other sites More sharing options...
Dayo Posted August 10, 2009 Share Posted August 10, 2009 Re: Count Down Clock all you have to do is add somat like ".$set['time']." then add somat in cron min to add a min") Quote Link to comment Share on other sites More sharing options...
Danny696 Posted August 10, 2009 Author Share Posted August 10, 2009 Re: Count Down Clock all you have to do is add somat like ".$set['time']." then add somat in cron min to add a min") ive done something like that but why would it be $set Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.