From the opening of the Beijing 2008 Olympic Games, the special effects, a simple demonstration!
From the opening of the Beijing Olympic Games
<br>
<title> Countdown Test </title>
<!--countdown Set code-->
<script language= "JavaScript" >
<!--hide script from old browser
var differencehour =-1
var differenceminute =-1
var Differencesecond =-1
var tday = new Date ("Aug 8, 2008 20:00:00")//** countdown time Point-note format
var daysms = 24 * 60 * 60 * 1000
var hoursms = 60 * 60 * 1000
var Secondms = 60 * 1000
var microsecond = 1000
function Clock ()
{
var time = new Date ()
var hour = time.gethours ()
var minute = Time.getminutes ()
var second = Time.getseconds ()
var timevalue = "" + (Hour > 12)? Hour-12:hour)
TimeValue + + (Minute < 10)? ": 0": ":") +minute
TimeValue + + (Second < 10)? ": 0": ":") +second
TimeValue + = ((Hour >12)? "PM": "AM")
Document.formnow.now.value = TimeValue
var converthour = Differencehour
var convertminute = Differenceminute
var Convertsecond = Differencesecond
var diffms = Tday.gettime ()-Time.gettime ()
Differencehour = Math.floor (diffms/daysms)
DIFFMS-= Differencehour * daysms
Differenceminute = Math.floor (diffms/hoursms)
DIFFMS-= Differenceminute * hoursms
Differencesecond = Math.floor (DIFFMS/SECONDMS)
DIFFMS-= Differencesecond * SECONDMS
var dsecs = Math.floor (Diffms/microsecond)
if (converthour!= differencehour) document.formnow.dd.value=differencehour
if (Convertminute!= differenceminute) document.formnow.hh.value=differenceminute
if (Convertsecond!= differencesecond) document.formnow.mm.value=differencesecond
Document.formnow.ss.value=dsecs
document.formnow.tnow.value= Differencehour Differenceminute + differencesecond + dsecs
SetTimeout ("clock ()", 1000)
}
End Hiding-->
</script>
<!--the onload inside the body notice-->
<body onload= "clock (); return true" text= "Red" >
<!--implementation display-->
<form name= "Formnow" >
<input name= "dd" type= "text" style= "border:0;" size=2>
Days
<input name= "hh" type= "text" style= "border:0;"
Hours
<input name= "MM" type= "text" style= "border:0;" size=2>
Part
<input name= "ss" type= "text" style= "border:0;" size=2>
Seconds
</form>
<!--Countdown is complete-->