JAVA Dynamic Effects (1) Table Clock

Source: Internet
Author: User

<Body onLoad = "startit ()">
<Script LANGUAGE = "JavaScript">
<! --
Var isn1 = null;
Var isn2 = false;
Today = new Date ();
Function stopit ()
{
If (isn2)
{
ClearTimeout (isn1 );
}
Isn2 = false;
}
Function startit ()
{
Stopit ();
Isnclock ();
}
Function isnclock ()
{
Var now = new Date ();
Var hrs = now. getHours ();
Var min = now. getMinutes ();
Var sec = now. getSeconds ();
Document. clckh. disp1.value = "" + (hrs> 12 )? Hrs-12: hrs );
Document. clckh. disp2.value = (min <10 )? "0": "") + min;
Document. clckh. disp3.value = (sec <10 )? "0": "") + sec;
Document. clckh. disp4.value = (hrs> = 12 )? "Afternoon": "Morning ";
Isn1 = setTimeout ("isnclock ()", 1000 );
Isn2 = true;
}
Function isnArray ()
{
Argnr = isnArray. arguments. length
For (var I = 0;
I <argnr;
I ++)
{
This [I + 1] = isnArray. arguments [I];
}
}
Var isnMonths = new isnArray ("August", "August ", "August September", "August October", "August November", "August December ");
Var isnDays = new isnArray ("Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday "); isnDays [0] = "Sunday ";
// -->
</Script>
<Form NAME = "clckh" onSubmit = "0">
<Table BORDER = "2">
<Tr>
<Td> time </td>
<Td> <div align = "center"> <center> <p> point </td>
<Td align = "center"> <div align = "center"> <center> <p> score </td>
<Td align = "center"> <div align = "center"> <center> <p> seconds </td>
<Td align = "center"> </td>

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.