Hehe is not very accurate, understand friends do not laugh at me. Although I want to do very accurate, but the algorithm is too cumbersome, so use a simple and convenient.
Copy Code code as follows:
<script language= "JavaScript" >
/*
Screen.availwidth = Screen Work area width
Screen.availheight = high screen work area
*/
var wwidth = screen.availwidth-(screen.availwidth-370+78)-100;
var wheight = 20;
var wleft = screen.availwidth-370+78;
var wTop = 0;
Window.moveto (Wleft,wtop);
Window.resizeto (Wwidth,wheight);
</script>
<script language= "VBScript" >
UName = "Xiao Cai"
Ubirthday = #1981-01-25 00:00:00#
Usex = 1 ' "' 0 = female 1 = male" "
Lage = Array (20,22)
Ldate = DATEADD ("yyyy", Lage (Usex), Ubirthday)
</script>
<! DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 transitional//en" >
<meta http-equiv=content-type content= "text/html; charset=gb2312 ">
<title> Marriage </title>
Id= "Hta_pro_marriage"
Applicationname= "Pro_marriage"
Border= "None"
Caption= "No"
Scroll= "No"
Singleinstance= "Yes"
Windowstate= "Normal"
Showintaskbar= "No"
>
<style>
Body {
margin:0px;
}
Body,td,div {
Font-family: "The song Body";
font-size:14px;
}
IMG, table, TD, Div {
border:0px;
}
</style>
<script language= "VBScript" >
Dim sdate,nday,nmonth,nyear,nsecond,nminute,nhour
function ShowTime ()
Nday = Day (now ())
Nhour = Hour (now ())
Nminute = Minute (now ())
Nsecond = Second (now ())
Dhour = Hour (ldate)-Nhour
Dminute = Minute (ldate)-Nminute
Dsecond = Second (ldate)-Nsecond
If Dsecond < 0 Then
Dminute = dMinute-1
Dsecond = Dsecond + 60
End If
If Dminute < 0 Then
Dhour = DHour-1
Dminute = Dminute + 60
End If
If Dhour < 0 Then
Nday = nDay-1
Dhour = Dhour + 24
End If
If Dsecond = 0 Then
Call Showdate ()
End If
document.getElementById ("MyDIV2"). Innerhtml=sdate & "& Dhour &" "& Dminute &" Minutes "& Dsecond &A mp Seconds
SetTimeout "ShowTime ()", 1*1000
End Function
function Showdate ()
Nyear = year (now ())
Nmonth = Month (now ())
Dyear = year (ldate)-nyear
Dmonth = Month (ldate)-Nmonth
DDay = Day (ldate)-Nday
If DDay < 0 Then
Dmonth = dMonth-1
DDay = DDay + 30
End If
If Dmonth < 0 Then
Dyear = DYear-1
Dmonth = Dmonth + 12
End If
Sdate = Dyear & "Year" & Dmonth & "Month" & DDay & "Day"
' document.getElementById ("MyDIV1"). Innerhtml= "<font color=red>" & UName & "</font> according to legal age of marriage < Font color=blue> "& Lage (usex) &" </font> years old "
End Function
</script>
<body onload= "ShowTime (); Showdate (); " >
<div id= "MyDIV1" style= "PADDING-LEFT:3PX;PADDING-TOP:2PX;" ></div>
<div id= "MyDIV2" style= "PADDING-LEFT:7PX;PADDING-BOTTOM:2PX;" ></div>
</body>