Jump to content
MakeWebGames

Count Down Clock


Danny696

Recommended Posts

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

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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...

Link to comment
Share on other sites

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

Link to comment
Share on other sites

  • 2 weeks later...

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);
Link to comment
Share on other sites

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

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...