https://www.slit.cn/thread-38699-1-1.html 东营_网页特效之时间日期篇_胜利社区_东营论坛_学习与教育

胜利社区

搜索

网页特效之时间日期篇

[复制链接]
分享到:
发表于 2008-3-10 09:32 | 显示全部楼层 |阅读模式 来自:LAN
一个很漂亮实用的日历!!!!
  1. <html>

  2. <head>
  3. <meta http-equiv="Content-Type" content="text/html; charset=gb2312">
  4. <title>我搜特效代码基地,一个很漂亮实用的日历</title>
  5. <SCRIPT LANGUAGE="JavaScript" TYPE="text/javascript">
  6. //创建一个数组,用于存放每个月的天数
  7. function montharr(m0, m1, m2, m3, m4, m5, m6, m7, m8, m9, m10, m11)
  8. {
  9. this[0] = m0;
  10. this[1] = m1;
  11. this[2] = m2;
  12. this[3] = m3;
  13. this[4] = m4;
  14. this[5] = m5;
  15. this[6] = m6;
  16. this[7] = m7;
  17. this[8] = m8;
  18. this[9] = m9;
  19. this[10] = m10;
  20. this[11] = m11;
  21. }
  22. //实现月历
  23. function calendar() {
  24. var monthNames = "JanFebMarAprMayJunJulAugSepOctNovDec";
  25. var today = new Date();
  26. var thisDay;
  27. var monthDays = new montharr(31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31);
  28. year = today.getYear() +1900;
  29. thisDay = today.getDate();
  30. if (((year % 4 == 0)  &&  (year % 100 != 0)) || (year % 400 == 0)) monthDays[1] = 29;
  31. nDays = monthDays[today.getMonth()];
  32. firstDay = today;
  33. firstDay.setDate(1);
  34. testMe = firstDay.getDate();
  35. if (testMe == 2) firstDay.setDate(0);
  36. startDay = firstDay.getDay();
  37. document.write("<div id='rili' style='position:absolute;width:140px;left:300px;top:100px;'>")
  38. document.write("<TABLE width='217' BORDER='0' CELLSPACING='0' CELLPADDING='2' BGCOLOR='#0080FF'>")
  39. document.write("<TR><TD><table border='0' cellspacing='1' cellpadding='2' bgcolor='Silver'>");
  40. document.write("<TR><th colspan='7' bgcolor='#C8E3FF'>");
  41. var dayNames = new Array("星期日","星期一","星期二","星期三","星期四","星期五","星期六");
  42. var monthNames = new Array("1月","2月","3月","4月","5月","6月","7月","8月","9月","10月","11月","12月");
  43. var now = new Date();
  44. document.writeln("<FONT STYLE='font-size:9pt;Color:#330099'>" + "公元 " + now.getYear() + "年" + monthNames[now.getMonth()] + " " + now.getDate() + "日 " + dayNames[now.getDay()] + "</FONT>");
  45. document.writeln("</TH></TR><TR><TH BGCOLOR='#0080FF'><FONT STYLE='font-size:9pt;Color:White'>日</FONT></TH>");
  46. document.writeln("<th bgcolor='#0080FF'><FONT STYLE='font-size:9pt;Color:White'>一</FONT></TH>");
  47. document.writeln("<TH BGCOLOR='#0080FF'><FONT STYLE='font-size:9pt;Color:White'>二</FONT></TH>");
  48. document.writeln("<TH BGCOLOR='#0080FF'><FONT STYLE='font-size:9pt;Color:White'>三</FONT></TH>");
  49. document.writeln("<TH BGCOLOR='#0080FF'><FONT STYLE='font-size:9pt;Color:White'>四</FONT></TH>");
  50. document.writeln("<TH BGCOLOR='#0080FF'><FONT STYLE='font-size:9pt;Color:White'>五</FONT></TH>");
  51. document.writeln("<TH BGCOLOR='#0080FF'><FONT STYLE='font-size:9pt;Color:White'>六</FONT></TH>");
  52. document.writeln("</TR><TR>");
  53. column = 0;
  54. for (i=0; i<startDay; i++) {
  55. document.writeln("\n<TD><FONT STYLE='font-size:9pt'> </FONT></TD>");
  56. column++;
  57. }

  58. for (i=1; i<=nDays; i++) {
  59. if (i == thisDay) {
  60. document.writeln("</TD><TD ALIGN='CENTER' BGCOLOR='#FF8040'><FONT STYLE='font-size:9pt;Color:#ffffff'><B>")
  61. }
  62. else {
  63. document.writeln("</TD><TD BGCOLOR='#FFFFFF' ALIGN='CENTER'><FONT STYLE='font-size:9pt;font-family:Arial;font-weight:bold;Color:#330066'>");
  64. }
  65. document.writeln(i);
  66. if (i == thisDay) document.writeln("</FONT></TD>")
  67. column++;
  68. if (column == 7) {
  69. document.writeln("<TR>");
  70. column = 0;
  71. }
  72. }
  73. document.writeln("<TR><TD COLSPAN='7' ALIGN='CENTER' VALIGN='TOP' BGCOLOR='#0080FF'>")
  74. document.writeln("<FORM NAME='clock' onSubmit='0'><FONT STYLE='font-size:9pt;Color:#ffffff'>")
  75. document.writeln("现在时间:<INPUT TYPE='Text' NAME='face' ALIGN='TOP'></FONT></FORM></TD></TR></TABLE>")
  76. document.writeln("</TD></TR></TABLE></div>");
  77. }
  78. </SCRIPT>
  79. <SCRIPT LANGUAGE="JavaScript">
  80. var timerID = null;
  81. var timerRunning = false;

  82. function stopclock (){
  83. if(timerRunning)
  84. clearTimeout(timerID);
  85. timerRunning = false;}

  86. //显示当前时间
  87. function showtime () {
  88. var now = new Date();
  89. var hours = now.getHours();
  90. var minutes = now.getMinutes();
  91. var seconds = now.getSeconds()
  92. var timeValue = " " + ((hours >12) ? hours -12 :hours)
  93. timeValue += ((minutes < 10) ? ":0" : ":") + minutes
  94. timeValue += ((seconds < 10) ? ":0" : ":") + seconds
  95. timeValue += (hours >= 12) ? " 下午 " : " 上午 "
  96. document.clock.face.value = timeValue;
  97. timerID = setTimeout("showtime()",1000);//设置超时,使时间动态显示
  98. timerRunning = true;}

  99. function startclock () {
  100. stopclock();
  101. showtime();}
  102. </SCRIPT>
  103. </head>

  104. <body onLoad="startclock(); timerONE=window.setTimeout">

  105. <script language="JavaScript" type="text/javascript">
  106. <!--
  107. calendar();
  108. //-->

  109. </script>

  110. </body>

  111. </html>
复制代码
免责声明:用户在本平台发表的内容(如有图片或视频亦包括在内)仅表明其个人观点,不代表本平台观点,本平台亦不承担任何法律及连带责任,本平台仅提供信息存储服务;本平台发布的信息仅为传递、参考之用,不构成任何投资、使用等行为的建议。任何后果均由用户自行承担;转载文章的版权归原作者所有,如有侵权,请与我们取得联系,我们将立即整改或删除相关内容。
 楼主| 发表于 2008-3-10 09:33 | 显示全部楼层 来自:LAN
显示公历和农历
  1. <html>
  2. <head>
  3. <title>我搜特效代码基地</title>
  4. <meta http-equiv="Content-Type" content="text/html; charset=gb2312">
  5. <STYLE type=text/css>
  6. td,body,input,select { font-size: 12px; line-height:150%}
  7. A:link{COLOR:#000000;TEXT-DECORATION:none line-height:150%}
  8. A:visited{COLOR:#00000C;TEXT-DECORATION:none;TEXT-DECORATION:none}
  9. A:active{COLOR:#009966;TEXT-DECORATION:underline}
  10. A:hover{COLOR:#ff0000;TEXT-DECORATION:underline}
  11. .white_bg {COLOR: #4397C5; FONT-SIZE: 9pt}
  12. .t{LINE-HEIGHT: 1.4}
  13. BODY{FONT-FAMILY: 宋体; FONT-SIZE: 9pt;line-height:150%
  14. SCROLLBAR-HIGHLIGHT-COLOR: buttonface;
  15. SCROLLBAR-SHADOW-COLOR: buttonface;
  16. SCROLLBAR-3DLIGHT-COLOR: buttonhighlight;
  17. SCROLLBAR-TRACK-COLOR: #cccccc;
  18. SCROLLBAR-DARKSHADOW-COLOR: buttonshadow}
  19. .center05 td{color:#000000;line-height:140%;font-size:12px}
  20. .menu {FONT-SIZE: 12px; FILTER: dropshadow(color=#ffffff,offx=1,offy=1); COLOR: #000000; LINE-HEIGHT: 20px; FONT-FAMILY: "宋体,Verdana"}
  21. .article {font-size:12px;line-height:140%}
  22. </style></head>
  23. <body bgcolor="#FFFFFF" text="#000000">
  24. <SCRIPT language=JavaScript>
  25.             <!--
  26. function CalConv()
  27. {
  28. FIRSTYEAR = 1998;
  29. LASTYEAR = 2031;
  30.         today = new Date();
  31.         SolarYear = today.getFullYear();
  32.         SolarMonth = today.getMonth() + 1;
  33.         SolarDate = today.getDate();
  34.         Weekday = today.getDay();
  35.         LunarCal = [
  36.   new tagLunarCal( 27,  5, 3, 43, 1, 0, 0, 1, 0, 0, 1, 1, 0, 1, 1, 0, 1 ),
  37.   new tagLunarCal( 46,  0, 4, 48, 1, 0, 0, 1, 0, 0, 1, 0, 1, 1, 1, 0, 1 ), /* 88 */
  38.   new tagLunarCal( 35,  0, 5, 53, 1, 1, 0, 0, 1, 0, 0, 1, 0, 1, 1, 0, 1 ), /* 89 */
  39.   new tagLunarCal( 23,  4, 0, 59, 1, 1, 0, 1, 0, 1, 0, 0, 1, 0, 1, 0, 1 ),
  40.   new tagLunarCal( 42,  0, 1,  4, 1, 1, 0, 1, 0, 1, 0, 0, 1, 0, 1, 0, 1 ),
  41.   new tagLunarCal( 31,  0, 2,  9, 1, 1, 0, 1, 1, 0, 1, 0, 0, 1, 0, 1, 0 ),
  42.   new tagLunarCal( 21,  2, 3, 14, 0, 1, 0, 1, 1, 0, 1, 0, 1, 0, 1, 0, 1 ), /* 93 */
  43.   new tagLunarCal( 39,  0, 5, 20, 0, 1, 0, 1, 0, 1, 1, 0, 1, 0, 1, 0, 1 ),
  44.   new tagLunarCal( 28,  7, 6, 25, 1, 0, 1, 0, 1, 0, 1, 0, 1, 1, 0, 1, 1 ),
  45.   new tagLunarCal( 48,  0, 0, 30, 0, 0, 1, 0, 0, 1, 0, 1, 1, 1, 0, 1, 1 ),
  46.   new tagLunarCal( 37,  0, 1, 35, 1, 0, 0, 1, 0, 0, 1, 0, 1, 1, 0, 1, 1 ), /* 97 */
  47.   new tagLunarCal( 25,  5, 3, 41, 1, 1, 0, 0, 1, 0, 0, 1, 0, 1, 0, 1, 1 ),
  48.   new tagLunarCal( 44,  0, 4, 46, 1, 0, 1, 0, 1, 0, 0, 1, 0, 1, 0, 1, 1 ),
  49.   new tagLunarCal( 33,  0, 5, 51, 1, 0, 1, 1, 0, 1, 0, 0, 1, 0, 1, 0, 1 ),
  50.   new tagLunarCal( 22,  4, 6, 56, 1, 0, 1, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0 ), /* 101 */
  51.   new tagLunarCal( 40,  0, 1,  2, 1, 0, 1, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0 ),
  52.   new tagLunarCal( 30,  9, 2,  7, 0, 1, 0, 1, 0, 1, 0, 1, 1, 0, 1, 0, 1 ),
  53.   new tagLunarCal( 49,  0, 3, 12, 0, 1, 0, 0, 1, 0, 1, 1, 1, 0, 1, 0, 1 ),
  54.   new tagLunarCal( 38,  0, 4, 17, 1, 0, 1, 0, 0, 1, 0, 1, 1, 0, 1, 1, 0 ), /* 105 */
  55.   new tagLunarCal( 27,  6, 6, 23, 0, 1, 0, 1, 0, 0, 1, 0, 1, 0, 1, 1, 1 ),
  56.   new tagLunarCal( 46,  0, 0, 28, 0, 1, 0, 1, 0, 0, 1, 0, 1, 0, 1, 1, 0 ),
  57.   new tagLunarCal( 35,  0, 1, 33, 0, 1, 1, 0, 1, 0, 0, 1, 0, 0, 1, 1, 0 ),
  58.   new tagLunarCal( 24,  4, 2, 38, 0, 1, 1, 1, 0, 1, 0, 0, 1, 0, 1, 0, 1 ), /* 109 */
  59.   new tagLunarCal( 42,  0, 4, 44, 0, 1, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1 ),
  60.   new tagLunarCal( 31,  0, 5, 49, 1, 0, 1, 0, 1, 1, 0, 1, 0, 1, 0, 1, 0 ),
  61.   new tagLunarCal( 21,  2, 6, 54, 0, 1, 0, 1, 0, 1, 0, 1, 1, 0, 1, 0, 1 ),
  62.   new tagLunarCal( 40,  0, 0, 59, 0, 1, 0, 0, 1, 0, 1, 1, 0, 1, 1, 0, 1 ), /* 113 */
  63.   new tagLunarCal( 28,  6, 2,  5, 1, 0, 1, 0, 0, 1, 0, 1, 0, 1, 1, 1, 0 ),
  64.   new tagLunarCal( 47,  0, 3, 10, 1, 0, 1, 0, 0, 1, 0, 0, 1, 1, 1, 0, 1 ),
  65.   new tagLunarCal( 36,  0, 4, 15, 1, 1, 0, 1, 0, 0, 1, 0, 0, 1, 1, 0, 1 ),
  66.   new tagLunarCal( 25,  5, 5, 20, 1, 1, 1, 0, 1, 0, 0, 1, 0, 0, 1, 1, 0 ), /* 117 */
  67.   new tagLunarCal( 43,  0, 0, 26, 1, 1, 0, 1, 0, 1, 0, 1, 0, 0, 1, 0, 1 ),
  68.   new tagLunarCal( 32,  0, 1, 31, 1, 1, 0, 1, 1, 0, 1, 0, 1, 0, 1, 0, 0 ),
  69.   new tagLunarCal( 22,  3, 2, 36, 0, 1, 1, 0, 1, 0, 1, 1, 0, 1, 0, 1, 0 ) ];
  70. /* 年每月之日數 */
  71. SolarCal = [ 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 ];
  72. /* 年每月之累積日數, 平年與閏年 */
  73. SolarDays = [  0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334, 365, 396,  0, 31, 60, 91, 121, 152, 182, 213, 244, 274, 305, 335, 366, 397 ];
  74.         AnimalIdx = ["马", "羊", "猴", "鸡", "狗", "猪", "鼠", "牛", "虎", "兔", "龙", "蛇" ];
  75.         LocationIdx = [ "南", "东", "北", "西" ];
  76.         if ( SolarYear <= FIRSTYEAR || SolarYear > LASTYEAR ) return 1;
  77.         sm = SolarMonth - 1;
  78.                 if ( sm < 0 || sm > 11 ) return 2;
  79.                 leap = GetLeap( SolarYear );
  80.         if ( sm == 1 )
  81.                 d = leap + 28;
  82.         else
  83.                 d = SolarCal[sm];
  84.         if ( SolarDate < 1 || SolarDate > d ) return 3;
  85.         y = SolarYear - FIRSTYEAR;
  86.         acc = SolarDays[ leap*14 + sm ] + SolarDate;
  87.         kc = acc + LunarCal[y].BaseKanChih;
  88.         Kan = kc % 10;
  89.         Chih = kc % 12;
  90.         Location = LocationIdx[kc % 4];
  91.         Age = kc % 60;
  92.         if ( Age < 22 )
  93.                 Age = 22 - Age;
  94.         else
  95.                 Age = 82 - Age;
  96.         Animal = AnimalIdx[ Chih ];
  97.         if ( acc <= LunarCal[y].BaseDays ) {
  98.                 y--;
  99.                 LunarYear = SolarYear - 1;
  100.                 leap = GetLeap( LunarYear );
  101.                 sm += 12;
  102.                 acc = SolarDays[leap*14 + sm] + SolarDate;
  103.          }
  104.         else
  105.                 LunarYear = SolarYear;
  106.                         l1 = LunarCal[y].BaseDays;
  107.         for ( i=0; i<13; i++ ) {
  108.                 l2 = l1 + LunarCal[y].MonthDays[i] + 29;
  109.                 if ( acc <= l2 ) break;
  110.                 l1 = l2;
  111.          }
  112.         LunarMonth = i + 1;
  113.         LunarDate = acc - l1;
  114.         im = LunarCal[y].Intercalation;
  115.         if ( im != 0 && LunarMonth > im ) {
  116.                 LunarMonth--;
  117.                 if ( LunarMonth == im ) LunarMonth = -im;
  118.          }
  119.         if ( LunarMonth > 12 ) LunarMonth -= 12;
  120. today=new Date();
  121.         function initArray(){
  122.                          this.length=initArray.arguments.length
  123.                          for(var i=0;i<this.length;i++)
  124.                          this[i+1]=initArray.arguments[i]  }
  125.        var d=new initArray("星期日","星期一","星期二","星期三","星期四","星期五","星期六");
  126.              document.write("<span class="jsdhtml"> ", today.getYear(),"年",today.getMonth()+1,"月",today.getDate(),"日 ",d[today.getDay()+1],"");
  127.           document.write( "<span class="jsdhtml"> 农历" + LunarMonth + "月" +LunarDate +"日");
  128.                                   return 0;
  129. }
  130. /* 求此年是否為閏年, 返回 0 為平年, 1 為閏年 */
  131. function GetLeap( year )
  132. {
  133.    if ( year % 400 == 0 )
  134.      return 1;
  135.    else if ( year % 100 == 0 )
  136.      return 0;
  137.    else if ( year % 4 == 0 )
  138.      return 1;
  139.    else
  140.      return 0;
  141. }
  142. function tagLunarCal( d, i, w, k, m1, m2, m3, m4, m5, m6, m7, m8, m9, m10, m11, m12, m13) {
  143. this.BaseDays = d;         /* 到 1 月 1 日到農曆正月初一的累積日數 */
  144. this.Intercalation = i;    /* 閏月月份. 0==此年沒有閏月 */
  145. this.BaseWeekday = w;      /* 此年 1 月 1 日為星期幾再減 1 */
  146. this.BaseKanChih = k;      /* 此年 1 月 1 日之干支序號減 1 */
  147. this.MonthDays = [ m1, m2, m3, m4, m5, m6, m7, m8, m9, m10, m11, m12, m13 ]; /* 此農曆年每月之大小, 0==小月(29日), 1==大月(30日) */
  148. }
  149. //-->
  150. CalConv();
  151.                                                                                                                      </SCRIPT>

  152.             

  153. </body>
  154. </html>
复制代码
免责声明:用户在本平台发表的内容(如有图片或视频亦包括在内)仅表明其个人观点,不代表本平台观点,本平台亦不承担任何法律及连带责任,本平台仅提供信息存储服务;本平台发布的信息仅为传递、参考之用,不构成任何投资、使用等行为的建议。任何后果均由用户自行承担;转载文章的版权归原作者所有,如有侵权,请与我们取得联系,我们将立即整改或删除相关内容。
回复 支持 反对

使用道具 举报

 楼主| 发表于 2008-3-10 09:35 | 显示全部楼层 来自:LAN
下拉时间
  1. <form>
  2. <select id=year onchange=toDate()>
  3. <script>for(i=1970;i<=2010;i++)document.write("<option>"+i+"</option>")</script>
  4. </select>
  5. <select id=month onchange=toDate()>
  6. <script>for(i=1;i<=12;i++)document.write("<option>"+i+"</option>")</script>
  7. </select>
  8. <select id=day onchange=toDay()></select>
  9. <input name=weekday>
  10. </form>
  11. <script>
  12. var arr="日一二三四五六".split("")

  13. function toDate(){
  14.         with(document.all){
  15.                 vYear=parseInt(year.options[year.selectedIndex].text)
  16.                 vMonth=parseInt(month.options[month.selectedIndex].text)
  17.                 day.length=0;
  18.                 for(i=0;i<(new Date(vYear,vMonth,0)).getDate();i++){day.options[day.length++].value=day.length;day.options[day.length-1].text=day.length;}
  19.         }
  20.         toDay();
  21. }

  22. function toDay(){
  23.         vDay=parseInt(document.all.day.options[document.all.day.selectedIndex].value)
  24.         document.all("weekday").value="星期"+arr[new Date(vYear,vMonth-1,vDay).getDay()]
  25. }

  26. window.onload=toDate;
  27. </script>
复制代码
免责声明:用户在本平台发表的内容(如有图片或视频亦包括在内)仅表明其个人观点,不代表本平台观点,本平台亦不承担任何法律及连带责任,本平台仅提供信息存储服务;本平台发布的信息仅为传递、参考之用,不构成任何投资、使用等行为的建议。任何后果均由用户自行承担;转载文章的版权归原作者所有,如有侵权,请与我们取得联系,我们将立即整改或删除相关内容。
回复 支持 反对

使用道具 举报

 楼主| 发表于 2008-3-10 09:38 | 显示全部楼层 来自:LAN
超级酷挂历
  1. <!--要完成此效果把如下代码加入到<body>区域中-->

  2. <STYLE>A.menuitem {
  3.     COLOR: menutext; TEXT-DECORATION: none
  4. }
  5. A.menuitem:hover {
  6.     COLOR: highlighttext; BACKGROUND-COLOR: highlight
  7. }
  8. DIV.contextmenu {
  9.     BORDER-RIGHT: 2px outset; BORDER-TOP: 2px outset; Z-INDEX: 999; VISIBILITY: hidden; BORDER-LEFT: 2px outset; BORDER-BOTTOM: 2px outset; POSITION: absolute; BACKGROUND-COLOR: buttonface
  10. }

  11. </STYLE>
  12. <SCRIPT language=JavaScript>
  13. function Year_Month(){
  14.     var now = new Date();
  15.     var yy = now.getYear();
  16.     var mm = now.getMonth()+1;
  17.     var cl = '<font color="#0000df">';
  18.     if (now.getDay() == 0) cl = '<font color="#c00000">';
  19.     if (now.getDay() == 6) cl = '<font color="#00c000">';
  20.     return(cl +  yy + '年' + mm + '月</font>'); }
  21. function Date_of_Today(){
  22.     var now = new Date();
  23.     var cl = '<font color="#ff0000">';
  24.     if (now.getDay() == 0) cl = '<font color="#c00000">';
  25.     if (now.getDay() == 6) cl = '<font color="#00c000">';
  26.     return(cl +  now.getDate() + '</font>'); }
  27. function Day_of_Today(){
  28.     var day = new Array();
  29.     day[0] = "星期日";
  30.     day[1] = "星期一";
  31.     day[2] = "星期二";
  32.     day[3] = "星期三";
  33.     day[4] = "星期四";
  34.     day[5] = "星期五";
  35.     day[6] = "星期六";
  36.     var now = new Date();
  37.     var cl = '<font color="#0000df">';
  38.     if (now.getDay() == 0) cl = '<font color="#c00000">';
  39.     if (now.getDay() == 6) cl = '<font color="#00c000">';
  40.     return(cl +  day[now.getDay()] + '</font>'); }
  41. function CurentTime(){
  42.     var now = new Date();
  43.     var hh = now.getHours();
  44.     var mm = now.getMinutes();
  45.     var ss = now.getTime() % 60000;
  46.     ss = (ss - (ss % 1000)) / 1000;
  47.     var clock = hh+':';
  48.     if (mm < 10) clock += '0';
  49.     clock += mm+':';
  50.     if (ss < 10) clock += '0';
  51.     clock += ss;
  52.     return(clock); }
  53. function refreshCalendarClock(){
  54. document.all.calendarClock1.innerHTML = Year_Month();
  55. document.all.calendarClock2.innerHTML = Date_of_Today();
  56. document.all.calendarClock3.innerHTML = Day_of_Today();
  57. document.all.calendarClock4.innerHTML = CurentTime(); }
  58. var webUrl = webUrl;
  59. document.write('<table border="0" cellpadding="0" cellspacing="0"><tr><td>');
  60. document.write('<table id="CalendarClockFreeCode" border="0" cellpadding="0" cellspacing="0" width="60" height="70" ');
  61. document.write('style="position:absolute;visibility:hidden" bgcolor="#eeeeee">');
  62. document.write('<tr><td align="center"><font ');
  63. document.write('style="cursor:hand;color:#ff0000;font-family:宋体;font-size:14pt;line-height:120%" ');
  64. if (webUrl != 'netflower'){
  65.    document.write('</td></tr><tr><td align="center"><font ');
  66.    document.write('style="cursor:hand;color:#2000ff;font-family:宋体;font-size:9pt;line-height:110%" ');
  67. }
  68. document.write('</td></tr></table>');
  69. document.write('<table border="0" cellpadding="0" cellspacing="0" width="61" bgcolor="#C0C0C0" height="70">');
  70. document.write('<tr><td valign="top" width="100%" height="100%">');
  71. document.write('<table border="1" cellpadding="0" cellspacing="0" width="58" bgcolor="#FEFEEF" height="67">');
  72. document.write('<tr><td align="center" width="100%" height="100%" >');
  73. document.write('<font id="calendarClock1" style="font-family:宋体;font-size:7pt;line-height:120%"> </font>
  74. ');
  75. document.write('<font id="calendarClock2" style="color:#ff0000;font-family:Arial;font-size:14pt;line-height:120%"> </font>
  76. ');
  77. document.write('<font id="calendarClock3" style="font-family:宋体;font-size:9pt;line-height:120%"> </font>
  78. ');
  79. document.write('<font id="calendarClock4" style="color:#100080;font-family:宋体;font-size:8pt;line-height:120%"><b> </b></font>');
  80. document.write('</td></tr></table>');
  81. document.write('</td></tr></table>');
  82. document.write('</td></tr></table>');
  83. setInterval('refreshCalendarClock()',1000);
  84. </SCRIPT>
复制代码
免责声明:用户在本平台发表的内容(如有图片或视频亦包括在内)仅表明其个人观点,不代表本平台观点,本平台亦不承担任何法律及连带责任,本平台仅提供信息存储服务;本平台发布的信息仅为传递、参考之用,不构成任何投资、使用等行为的建议。任何后果均由用户自行承担;转载文章的版权归原作者所有,如有侵权,请与我们取得联系,我们将立即整改或删除相关内容。
回复 支持 反对

使用道具 举报

 楼主| 发表于 2008-3-10 09:39 | 显示全部楼层 来自:LAN
超级酷挂历
  1. <!--要完成此效果把如下代码加入到<body>区域中-->

  2. <STYLE>A.menuitem {
  3.     COLOR: menutext; TEXT-DECORATION: none
  4. }
  5. A.menuitem:hover {
  6.     COLOR: highlighttext; BACKGROUND-COLOR: highlight
  7. }
  8. DIV.contextmenu {
  9.     BORDER-RIGHT: 2px outset; BORDER-TOP: 2px outset; Z-INDEX: 999; VISIBILITY: hidden; BORDER-LEFT: 2px outset; BORDER-BOTTOM: 2px outset; POSITION: absolute; BACKGROUND-COLOR: buttonface
  10. }

  11. </STYLE>
  12. <SCRIPT language=JavaScript>
  13. function Year_Month(){
  14.     var now = new Date();
  15.     var yy = now.getYear();
  16.     var mm = now.getMonth()+1;
  17.     var cl = '<font color="#0000df">';
  18.     if (now.getDay() == 0) cl = '<font color="#c00000">';
  19.     if (now.getDay() == 6) cl = '<font color="#00c000">';
  20.     return(cl +  yy + '年' + mm + '月</font>'); }
  21. function Date_of_Today(){
  22.     var now = new Date();
  23.     var cl = '<font color="#ff0000">';
  24.     if (now.getDay() == 0) cl = '<font color="#c00000">';
  25.     if (now.getDay() == 6) cl = '<font color="#00c000">';
  26.     return(cl +  now.getDate() + '</font>'); }
  27. function Day_of_Today(){
  28.     var day = new Array();
  29.     day[0] = "星期日";
  30.     day[1] = "星期一";
  31.     day[2] = "星期二";
  32.     day[3] = "星期三";
  33.     day[4] = "星期四";
  34.     day[5] = "星期五";
  35.     day[6] = "星期六";
  36.     var now = new Date();
  37.     var cl = '<font color="#0000df">';
  38.     if (now.getDay() == 0) cl = '<font color="#c00000">';
  39.     if (now.getDay() == 6) cl = '<font color="#00c000">';
  40.     return(cl +  day[now.getDay()] + '</font>'); }
  41. function CurentTime(){
  42.     var now = new Date();
  43.     var hh = now.getHours();
  44.     var mm = now.getMinutes();
  45.     var ss = now.getTime() % 60000;
  46.     ss = (ss - (ss % 1000)) / 1000;
  47.     var clock = hh+':';
  48.     if (mm < 10) clock += '0';
  49.     clock += mm+':';
  50.     if (ss < 10) clock += '0';
  51.     clock += ss;
  52.     return(clock); }
  53. function refreshCalendarClock(){
  54. document.all.calendarClock1.innerHTML = Year_Month();
  55. document.all.calendarClock2.innerHTML = Date_of_Today();
  56. document.all.calendarClock3.innerHTML = Day_of_Today();
  57. document.all.calendarClock4.innerHTML = CurentTime(); }
  58. var webUrl = webUrl;
  59. document.write('<table border="0" cellpadding="0" cellspacing="0"><tr><td>');
  60. document.write('<table id="CalendarClockFreeCode" border="0" cellpadding="0" cellspacing="0" width="60" height="70" ');
  61. document.write('style="position:absolute;visibility:hidden" bgcolor="#eeeeee">');
  62. document.write('<tr><td align="center"><font ');
  63. document.write('style="cursor:hand;color:#ff0000;font-family:宋体;font-size:14pt;line-height:120%" ');
  64. if (webUrl != 'netflower'){
  65.    document.write('</td></tr><tr><td align="center"><font ');
  66.    document.write('style="cursor:hand;color:#2000ff;font-family:宋体;font-size:9pt;line-height:110%" ');
  67. }
  68. document.write('</td></tr></table>');
  69. document.write('<table border="0" cellpadding="0" cellspacing="0" width="61" bgcolor="#C0C0C0" height="70">');
  70. document.write('<tr><td valign="top" width="100%" height="100%">');
  71. document.write('<table border="1" cellpadding="0" cellspacing="0" width="58" bgcolor="#FEFEEF" height="67">');
  72. document.write('<tr><td align="center" width="100%" height="100%" >');
  73. document.write('<font id="calendarClock1" style="font-family:宋体;font-size:7pt;line-height:120%"> </font>
  74. ');
  75. document.write('<font id="calendarClock2" style="color:#ff0000;font-family:Arial;font-size:14pt;line-height:120%"> </font>
  76. ');
  77. document.write('<font id="calendarClock3" style="font-family:宋体;font-size:9pt;line-height:120%"> </font>
  78. ');
  79. document.write('<font id="calendarClock4" style="color:#100080;font-family:宋体;font-size:8pt;line-height:120%"><b> </b></font>');
  80. document.write('</td></tr></table>');
  81. document.write('</td></tr></table>');
  82. document.write('</td></tr></table>');
  83. setInterval('refreshCalendarClock()',1000);
  84. </SCRIPT>
复制代码
免责声明:用户在本平台发表的内容(如有图片或视频亦包括在内)仅表明其个人观点,不代表本平台观点,本平台亦不承担任何法律及连带责任,本平台仅提供信息存储服务;本平台发布的信息仅为传递、参考之用,不构成任何投资、使用等行为的建议。任何后果均由用户自行承担;转载文章的版权归原作者所有,如有侵权,请与我们取得联系,我们将立即整改或删除相关内容。
回复 支持 反对

使用道具 举报

 楼主| 发表于 2008-3-10 09:43 | 显示全部楼层 来自:LAN
特酷的倒影时钟,靓!!!!
  1. 第一步:把如下代码加入<head>区域中
  2. <head>
  3. <style>
  4. .time { font-size: 12pt; line-height: 14pt; color:red;}
  5. </style>
  6. <SCRIPT language=JavaScript>
  7. <!-- Hiding
  8. var ctimer;

  9. function init(){
  10. if (document.all){
  11. tim2.style.left=tim1.style.posLeft;
  12. tim2.style.top=tim1.style.posTop+tim1.offsetHeight-6;
  13. settimes();
  14. }
  15. }

  16. function settimes(){
  17. var time= new Date();
  18. hours= time.getHours();
  19. mins= time.getMinutes();
  20. secs= time.getSeconds();
  21. if (hours<10)
  22. hours="0"+hours;
  23. if(mins<10)
  24. mins="0"+mins;
  25. if (secs<10)
  26. secs="0"+secs;
  27. tim1.innerHTML=hours+":"+mins+":"+secs
  28. tim2.innerHTML=hours+":"+mins+":"+secs
  29. ctimer=setTimeout('settimes()',960);
  30. }
  31. // Done hiding -->
  32. </SCRIPT>


  33. 第二步:把如下代码加入<body>区域中
  34. <DIV class=time id=tim1
  35. style="HEIGHT: 20px; LEFT: 50px; POSITION: absolute; TOP: 10px; WIDTH: 10px"></DIV>
  36. <DIV class=time id=tim2
  37. style="FILTER: flipv() alpha(opacity=20); FONT-STYLE: italic; POSITION: absolute"></DIV>

  38. 第三步:把<body>改为
  39. <body bgcolor="#fef4d9" onload="init()">
复制代码
免责声明:用户在本平台发表的内容(如有图片或视频亦包括在内)仅表明其个人观点,不代表本平台观点,本平台亦不承担任何法律及连带责任,本平台仅提供信息存储服务;本平台发布的信息仅为传递、参考之用,不构成任何投资、使用等行为的建议。任何后果均由用户自行承担;转载文章的版权归原作者所有,如有侵权,请与我们取得联系,我们将立即整改或删除相关内容。
回复 支持 反对

使用道具 举报

 楼主| 发表于 2008-3-10 09:45 | 显示全部楼层 来自:LAN
跟随鼠标飘动的双层时钟
  1. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
  2. <HTML><HEAD>
  3. <META http-equiv=Content-Type content="text/html; charset=windows-1252">
  4. <META content="MSHTML 6.00.2600.0" name=GENERATOR></HEAD>
  5. <BODY>
  6. <SCRIPT language=JavaScript>
  7. dCol='000000';//date colour.
  8. fCol='000000';//face colour.
  9. sCol='000000';//seconds colour.
  10. mCol='000000';//minutes colour.
  11. hCol='000000';//hours colour.
  12. ClockHeight=40;
  13. ClockWidth=40;
  14. ClockFromMouseY=0;
  15. ClockFromMouseX=100;

  16. //Alter nothing below! Alignments will be lost!

  17. d=new Array("SUNDAY","MONDAY","TUESDAY","WEDNESDAY","THURSDAY","FRIDAY","SATURDAY");
  18. m=new Array("JANUARY","FEBRUARY","MARCH","APRIL","MAY","JUNE","JULY","AUGUST","SEPTEMBER","OCTOBER","NOVEMBER","DECEMBER");
  19. date=new Date();
  20. day=date.getDate();
  21. year=date.getYear();
  22. if (year < 2000) year=year+1900;
  23. TodaysDate=" "+d[date.getDay()]+" "+day+" "+m[date.getMonth()]+" "+year;
  24. D=TodaysDate.split('');
  25. H='...';
  26. H=H.split('');
  27. M='....';
  28. M=M.split('');
  29. S='.....';
  30. S=S.split('');
  31. Face='1 2 3 4 5 6 7 8 9 10 11 12';
  32. font='Arial';
  33. size=1;
  34. speed=0.6;
  35. ns=(document.layers);
  36. ie=(document.all);
  37. Face=Face.split(' ');
  38. n=Face.length;
  39. a=size*10;
  40. ymouse=0;
  41. xmouse=0;
  42. scrll=0;
  43. props="<font face="+font+" size="+size+" color="+fCol+"><B>";
  44. props2="<font face="+font+" size="+size+" color="+dCol+"><B>";
  45. Split=360/n;
  46. Dsplit=360/D.length;
  47. HandHeight=ClockHeight/4.5
  48. HandWidth=ClockWidth/4.5
  49. HandY=-7;
  50. HandX=-2.5;
  51. scrll=0;
  52. step=0.06;
  53. currStep=0;
  54. y=new Array();x=new Array();Y=new Array();X=new Array();
  55. for (i=0; i < n; i++){y[i]=0;x[i]=0;Y[i]=0;X[i]=0}
  56. Dy=new Array();Dx=new Array();DY=new Array();DX=new Array();
  57. for (i=0; i < D.length; i++){Dy[i]=0;Dx[i]=0;DY[i]=0;DX[i]=0}
  58. if (ns){
  59. for (i=0; i < D.length; i++)
  60. document.write('<layer name="nsDate'+i+'" top=0 left=0 height='+a+' width='+a+'><center>'+props2+D[i]+'</center></layer>');
  61. for (i=0; i < n; i++)
  62. document.write('<layer name="nsFace'+i+'" top=0 left=0 height='+a+' width='+a+'><center>'+props+Face[i]+'</center></layer>');
  63. for (i=0; i < S.length; i++)
  64. document.write('<layer name=nsSeconds'+i+' top=0 left=0 width=15 height=15><font face=Arial size=3 color='+sCol+'><center><b>'+S[i]+'</b></center></layer>');
  65. for (i=0; i < M.length; i++)
  66. document.write('<layer name=nsMinutes'+i+' top=0 left=0 width=15 height=15><font face=Arial size=3 color='+mCol+'><center><b>'+M[i]+'</b></center></layer>');
  67. for (i=0; i < H.length; i++)
  68. document.write('<layer name=nsHours'+i+' top=0 left=0 width=15 height=15><font face=Arial size=3 color='+hCol+'><center><b>'+H[i]+'</b></center></layer>');
  69. }
  70. if (ie){
  71. document.write('<div id="Od" style="position:absolute;top:0px;left:0px"><div style="position:relative">');
  72. for (i=0; i < D.length; i++)
  73. document.write('<div id="ieDate" style="position:absolute;top:0px;left:0;height:'+a+';width:'+a+';text-align:center">'+props2+D[i]+'</B></div>');
  74. document.write('</div></div>');
  75. document.write('<div id="Of" style="position:absolute;top:0px;left:0px"><div style="position:relative">');
  76. for (i=0; i < n; i++)
  77. document.write('<div id="ieFace" style="position:absolute;top:0px;left:0;height:'+a+';width:'+a+';text-align:center">'+props+Face[i]+'</B></div>');
  78. document.write('</div></div>');
  79. document.write('<div id="Oh" style="position:absolute;top:0px;left:0px"><div style="position:relative">');
  80. for (i=0; i < H.length; i++)
  81. document.write('<div id="ieHours" style="position:absolute;width:16px;height:16px;font-family:Arial;font-size:16px;color:'+hCol+';text-align:center;font-weight:bold">'+H[i]+'</div>');
  82. document.write('</div></div>');
  83. document.write('<div id="Om" style="position:absolute;top:0px;left:0px"><div style="position:relative">');
  84. for (i=0; i < M.length; i++)
  85. document.write('<div id="ieMinutes" style="position:absolute;width:16px;height:16px;font-family:Arial;font-size:16px;color:'+mCol+';text-align:center;font-weight:bold">'+M[i]+'</div>');
  86. document.write('</div></div>')
  87. document.write('<div id="Os" style="position:absolute;top:0px;left:0px"><div style="position:relative">');
  88. for (i=0; i < S.length; i++)
  89. document.write('<div id="ieSeconds" style="position:absolute;width:16px;height:16px;font-family:Arial;font-size:16px;color:'+sCol+';text-align:center;font-weight:bold">'+S[i]+'</div>');
  90. document.write('</div></div>')
  91. }
  92. (ns)?window.captureEvents(Event.MOUSEMOVE):0;
  93. function Mouse(evnt){
  94. ymouse = (ns)?evnt.pageY+ClockFromMouseY-(window.pageYOffset):event.y+ClockFromMouseY;
  95. xmouse = (ns)?evnt.pageX+ClockFromMouseX:event.x+ClockFromMouseX;
  96. }
  97. (ns)?window.onMouseMove=Mouse:document.onmousemove=Mouse;
  98. function ClockAndAssign(){
  99. time = new Date ();
  100. secs = time.getSeconds();
  101. sec = -1.57 + Math.PI * secs/30;
  102. mins = time.getMinutes();
  103. min = -1.57 + Math.PI * mins/30;
  104. hr = time.getHours();
  105. hrs = -1.575 + Math.PI * hr/6+Math.PI*parseInt(time.getMinutes())/360;
  106. if (ie){
  107. Od.style.top=window.document.body.scrollTop;
  108. Of.style.top=window.document.body.scrollTop;
  109. Oh.style.top=window.document.body.scrollTop;
  110. Om.style.top=window.document.body.scrollTop;
  111. Os.style.top=window.document.body.scrollTop;
  112. }
  113. for (i=0; i < n; i++){
  114. var F=(ns)?document.layers['nsFace'+i]:ieFace[i].style;
  115. F.top=y[i] + ClockHeight*Math.sin(-1.0471 + i*Split*Math.PI/180)+scrll;
  116. F.left=x[i] + ClockWidth*Math.cos(-1.0471 + i*Split*Math.PI/180);
  117. }
  118. for (i=0; i < H.length; i++){
  119. var HL=(ns)?document.layers['nsHours'+i]:ieHours[i].style;
  120. HL.top=y[i]+HandY+(i*HandHeight)*Math.sin(hrs)+scrll;
  121. HL.left=x[i]+HandX+(i*HandWidth)*Math.cos(hrs);
  122. }
  123. for (i=0; i < M.length; i++){
  124. var ML=(ns)?document.layers['nsMinutes'+i]:ieMinutes[i].style;
  125. ML.top=y[i]+HandY+(i*HandHeight)*Math.sin(min)+scrll;
  126. ML.left=x[i]+HandX+(i*HandWidth)*Math.cos(min);
  127. }
  128. for (i=0; i < S.length; i++){
  129. var SL=(ns)?document.layers['nsSeconds'+i]:ieSeconds[i].style;
  130. SL.top=y[i]+HandY+(i*HandHeight)*Math.sin(sec)+scrll;
  131. SL.left=x[i]+HandX+(i*HandWidth)*Math.cos(sec);
  132. }
  133. for (i=0; i < D.length; i++){
  134. var DL=(ns)?document.layers['nsDate'+i]:ieDate[i].style;
  135. DL.top=Dy[i] + ClockHeight*1.5*Math.sin(currStep+i*Dsplit*Math.PI/180)+scrll;
  136. DL.left=Dx[i] + ClockWidth*1.5*Math.cos(currStep+i*Dsplit*Math.PI/180);
  137. }
  138. currStep-=step;
  139. }
  140. function Delay(){
  141. scrll=(ns)?window.pageYOffset:0;
  142. Dy[0]=Math.round(DY[0]+=((ymouse)-DY[0])*speed);
  143. Dx[0]=Math.round(DX[0]+=((xmouse)-DX[0])*speed);
  144. for (i=1; i < D.length; i++){
  145. Dy[i]=Math.round(DY[i]+=(Dy[i-1]-DY[i])*speed);
  146. Dx[i]=Math.round(DX[i]+=(Dx[i-1]-DX[i])*speed);
  147. }
  148. y[0]=Math.round(Y[0]+=((ymouse)-Y[0])*speed);
  149. x[0]=Math.round(X[0]+=((xmouse)-X[0])*speed);
  150. for (i=1; i < n; i++){
  151. y[i]=Math.round(Y[i]+=(y[i-1]-Y[i])*speed);
  152. x[i]=Math.round(X[i]+=(x[i-1]-X[i])*speed);
  153. }
  154. ClockAndAssign();
  155. setTimeout('Delay()',20);
  156. }
  157. if (ns||ie)window.onload=Delay;
  158. </SCRIPT>









  159. <FONT color=blue>Hi Guys this is
  160. amazing.</FONT size=20 Color=red>
  161. I do not know who wrote this HTML code.
  162. Asoka Liyanage.</BODY></HTML>
复制代码
免责声明:用户在本平台发表的内容(如有图片或视频亦包括在内)仅表明其个人观点,不代表本平台观点,本平台亦不承担任何法律及连带责任,本平台仅提供信息存储服务;本平台发布的信息仅为传递、参考之用,不构成任何投资、使用等行为的建议。任何后果均由用户自行承担;转载文章的版权归原作者所有,如有侵权,请与我们取得联系,我们将立即整改或删除相关内容。
回复 支持 反对

使用道具 举报

 楼主| 发表于 2008-3-10 09:47 | 显示全部楼层 来自:LAN
  1. 第一步:把如下代码加入<body>区域中
  2. <script language="JavaScript">
  3. <!-- Hide
  4.   var timerID = null
  5.   var timerRunning = false
  6.   function MakeArray(size)
  7.   {
  8.   this.length = size;
  9.   for(var i = 1; i <= size; i++)
  10.   {
  11.   this[i] = "";
  12.   }
  13.   return this;
  14.   }
  15.   function stopclock (){
  16.   if(timerRunning)
  17.   clearTimeout(timerID);
  18.   timerRunning = false
  19.   }
  20.   function showtime () {
  21.   var now = new Date();
  22.   var year = now.getYear();
  23.   var month = now.getMonth() + 1;
  24.   var date = now.getDate();
  25.   var hours = now.getHours();
  26.   var minutes = now.getMinutes();
  27.   var seconds = now.getSeconds();
  28.   var day = now.getDay();
  29.   Day = new MakeArray(7);
  30.   Day[0]="星期天";
  31.   Day[1]="星期一";
  32.   Day[2]="星期二";
  33.   Day[3]="星期三";
  34.   Day[4]="星期四";
  35.   Day[5]="星期五";
  36.   Day[6]="星期六";
  37.   var timeValue = "";
  38.   timeValue += year + "年";
  39.   timeValue += ((month < 10) ? "0" : "") + month + "月";
  40.   timeValue += date + "日  ";
  41.   timeValue += (Day[day]) + "  ";
  42.   timeValue += ((hours <= 12) ? hours : hours - 12);
  43.   timeValue += ((minutes < 10) ? ":0" : ":") + minutes;
  44.   timeValue += ((seconds < 10) ? ":0" : ":") + seconds;
  45.   timeValue += (hours < 12) ? "上午" : "下午";
  46.   document.jsfrm.face.value = timeValue;
  47.   timerID = setTimeout("showtime()",1000);
  48.   timerRunning = true
  49.   }
  50.   function startclock () {
  51.   stopclock();
  52.   showtime()
  53.   }
  54.   //-->

  55. </script>
  56. <form name='jsfrm'>
  57.                     <input type=text name='face' size=34 value=''>
  58.                   </form>

  59. 第二步:把<body>中的内容改为:
  60. <body bgcolor="#fef4d9" onLoad="startclock()">
复制代码
细的Form栏特全时钟
免责声明:用户在本平台发表的内容(如有图片或视频亦包括在内)仅表明其个人观点,不代表本平台观点,本平台亦不承担任何法律及连带责任,本平台仅提供信息存储服务;本平台发布的信息仅为传递、参考之用,不构成任何投资、使用等行为的建议。任何后果均由用户自行承担;转载文章的版权归原作者所有,如有侵权,请与我们取得联系,我们将立即整改或删除相关内容。
回复 支持 反对

使用道具 举报

 楼主| 发表于 2008-3-10 09:49 | 显示全部楼层 来自:LAN
最后更新日期显示
  1. 本页最后更新于
  2. <script LANGUAGE="JavaScript">
  3. function initArray()
  4. {
  5. this.length = initArray.arguments.length
  6. for (var i = 0; i < this.length; i++)
  7. this[i+1] = initArray.arguments[i]
  8. }
  9. var WeekArray = new initArray("星期日","星期一","星期二","星期三","星期四","星期五","星期六");
  10. var MonthArray = new initArray("1月","2月","3月","4月","5月","6月","7月","8月","9月","10月","11月","12月");
  11. var LastModDate = new Date(document.lastModified);
  12. document.write(LastModDate.getYear()+"年");
  13. document.write(MonthArray[(LastModDate.getMonth()+1)]);
  14. document.write(LastModDate.getDate()+"日 ");
  15. document.write(WeekArray[(LastModDate.getDay()+1)]);
  16. </script>。
复制代码
免责声明:用户在本平台发表的内容(如有图片或视频亦包括在内)仅表明其个人观点,不代表本平台观点,本平台亦不承担任何法律及连带责任,本平台仅提供信息存储服务;本平台发布的信息仅为传递、参考之用,不构成任何投资、使用等行为的建议。任何后果均由用户自行承担;转载文章的版权归原作者所有,如有侵权,请与我们取得联系,我们将立即整改或删除相关内容。
回复 支持 反对

使用道具 举报

 楼主| 发表于 2008-3-10 09:51 | 显示全部楼层 来自:LAN
  1. <style>
  2. <!--
  3. BODY {font-size: 12px;background-color: #d4d4d4;color: #0001fC;background-attachment: fixed;}
  4. td{font-size:12px; font-color:#000000}
  5. //-->
  6. </style>
  7. <script language="javascript">
  8. <!--
  9. var endNumber=true
  10. var mem=0
  11. var carry=10
  12. var hexnum="0123456789abcdef"
  13. var angle="d"
  14. var stack=""
  15. var level="0"
  16. var layer=0


  17. //数字键

  18. function inputkey(key)
  19. {
  20. var index=key.charCodeAt(0);
  21. if ((carry==2  &&  (index==48 || index==49))
  22. || (carry==8  &&  index>=48  &&  index<=55)
  23. || (carry==10  &&  (index>=48  &&  index<=57 || index==46))
  24. || (carry==16  &&  ((index>=48  &&  index<=57) || (index>=97  &&  index<=102))))
  25. if(endNumber)
  26. {
  27. endNumber=false
  28. document.calc.display.value = key
  29. }
  30. else if(document.calc.display.value == null || document.calc.display.value == "0")
  31. document.calc.display.value = key
  32. else
  33. document.calc.display.value += key
  34. }

  35. function changeSign()
  36. {
  37. if (document.calc.display.value!="0")
  38. if(document.calc.display.value.substr(0,1) == "-")
  39. document.calc.display.value = document.calc.display.value.substr(1)
  40. else
  41. document.calc.display.value = "-" + document.calc.display.value
  42. }

  43. //函数键

  44. function inputfunction(fun,shiftfun)
  45. {
  46. endNumber=true
  47. if (document.calc.shiftf.checked)
  48. document.calc.display.value=decto(funcalc(shiftfun,(todec(document.calc.display.value,carry))),carry)
  49. else
  50. document.calc.display.value=decto(funcalc(fun,(todec(document.calc.display.value,carry))),carry)
  51. document.calc.shiftf.checked=false
  52. document.calc.hypf.checked=false
  53. inputshift()
  54. }

  55. function inputtrig(trig,arctrig,hyp,archyp)
  56. {
  57. if (document.calc.hypf.checked)
  58. inputfunction(hyp,archyp)
  59. else
  60. inputfunction(trig,arctrig)
  61. }


  62. //运算符

  63. function operation(join,newlevel)
  64. {
  65. endNumber=true
  66. var temp=stack.substr(stack.lastIndexOf("(")+1)+document.calc.display.value
  67. while (newlevel!=0  &&  (newlevel<=(level.charAt(level.length-1))))
  68. {
  69. temp=parse(temp)
  70. level=level.slice(0,-1)
  71. }
  72. if (temp.match(/^(.*\d[\+\-\*\/\%\^\&\|x])?([+-]?[0-9a-f\.]+)$/))
  73. document.calc.display.value=RegExp.$2
  74. stack=stack.substr(0,stack.lastIndexOf("(")+1)+temp+join
  75. document.calc.operator.value=" "+join+" "
  76. level=level+newlevel

  77. }

  78. //括号

  79. function addbracket()
  80. {
  81. endNumber=true
  82. document.calc.display.value=0
  83. stack=stack+"("
  84. document.calc.operator.value="   "
  85. level=level+0

  86. layer+=1
  87. document.calc.bracket.value="(="+layer
  88. }

  89. function disbracket()
  90. {
  91. endNumber=true
  92. var temp=stack.substr(stack.lastIndexOf("(")+1)+document.calc.display.value
  93. while ((level.charAt(level.length-1))>0)
  94. {
  95. temp=parse(temp)
  96. level=level.slice(0,-1)
  97. }

  98. document.calc.display.value=temp
  99. stack=stack.substr(0,stack.lastIndexOf("("))
  100. document.calc.operator.value="   "
  101. level=level.slice(0,-1)

  102. layer-=1
  103. if (layer>0)
  104. document.calc.bracket.value="(="+layer
  105. else
  106. document.calc.bracket.value=""
  107. }

  108. //等号

  109. function result()
  110. {
  111. endNumber=true
  112. while (layer>0)
  113. disbracket()
  114. var temp=stack+document.calc.display.value
  115. while ((level.charAt(level.length-1))>0)
  116. {
  117. temp=parse(temp)
  118. level=level.slice(0,-1)
  119. }

  120. document.calc.display.value=temp
  121. document.calc.bracket.value=""
  122. document.calc.operator.value=""
  123. stack=""
  124. level="0"
  125. }


  126. //修改键

  127. function backspace()
  128. {
  129. if (!endNumber)
  130. {
  131. if(document.calc.display.value.length>1)
  132. document.calc.display.value=document.calc.display.value.substring(0,document.calc.display.value.length - 1)
  133. else
  134. document.calc.display.value=0
  135. }
  136. }

  137. function clearall()
  138. {
  139. document.calc.display.value=0
  140. endNumber=true
  141. stack=""
  142. level="0"
  143. layer=""
  144. document.calc.operator.value=""
  145. document.calc.bracket.value=""
  146. }


  147. //转换键

  148. function inputChangCarry(newcarry)
  149. {
  150. endNumber=true
  151. document.calc.display.value=(decto(todec(document.calc.display.value,carry),newcarry))
  152. carry=newcarry

  153. document.calc.sin.disabled=(carry!=10)
  154. document.calc.cos.disabled=(carry!=10)
  155. document.calc.tan.disabled=(carry!=10)
  156. document.calc.bt.disabled=(carry!=10)
  157. document.calc.pi.disabled=(carry!=10)
  158. document.calc.e.disabled=(carry!=10)
  159. document.calc.kp.disabled=(carry!=10)

  160. document.calc.k2.disabled=(carry<=2)
  161. document.calc.k3.disabled=(carry<=2)
  162. document.calc.k4.disabled=(carry<=2)
  163. document.calc.k5.disabled=(carry<=2)
  164. document.calc.k6.disabled=(carry<=2)
  165. document.calc.k7.disabled=(carry<=2)
  166. document.calc.k8.disabled=(carry<=8)
  167. document.calc.k9.disabled=(carry<=8)
  168. document.calc.ka.disabled=(carry<=10)
  169. document.calc.kb.disabled=(carry<=10)
  170. document.calc.kc.disabled=(carry<=10)
  171. document.calc.kd.disabled=(carry<=10)
  172. document.calc.ke.disabled=(carry<=10)
  173. document.calc.kf.disabled=(carry<=10)



  174. }

  175. function inputChangAngle(angletype)
  176. {
  177. endNumber=true
  178. angle=angletype
  179. if (angle=="d")
  180. document.calc.display.value=radiansToDegress(document.calc.display.value)
  181. else
  182. document.calc.display.value=degressToRadians(document.calc.display.value)
  183. endNumber=true
  184. }

  185. function inputshift()
  186. {
  187. if (document.calc.shiftf.checked)
  188. {
  189. document.calc.bt.value="deg "
  190. document.calc.ln.value="exp "
  191. document.calc.log.value="expd"

  192. if (document.calc.hypf.checked)
  193. {
  194. document.calc.sin.value="ahs "
  195. document.calc.cos.value="ahc "
  196. document.calc.tan.value="aht "
  197. }
  198. else
  199. {
  200. document.calc.sin.value="asin"
  201. document.calc.cos.value="acos"
  202. document.calc.tan.value="atan"
  203. }

  204. document.calc.sqr.value="x^.5"
  205. document.calc.cube.value="x^.3"

  206. document.calc.floor.value="小数"
  207. }
  208. else
  209. {
  210. document.calc.bt.value="d.ms"
  211. document.calc.ln.value=" ln "
  212. document.calc.log.value="log "

  213. if (document.calc.hypf.checked)
  214. {
  215. document.calc.sin.value="hsin"
  216. document.calc.cos.value="hcos"
  217. document.calc.tan.value="htan"
  218. }
  219. else
  220. {
  221. document.calc.sin.value="sin "
  222. document.calc.cos.value="cos "
  223. document.calc.tan.value="tan "
  224. }

  225. document.calc.sqr.value="x^2 "
  226. document.calc.cube.value="x^3 "

  227. document.calc.floor.value="取整"
  228. }

  229. }
  230. //存储器部分

  231. function clearmemory()
  232. {
  233. mem=0
  234. document.calc.memory.value="   "
  235. }

  236. function getmemory()
  237. {
  238. endNumber=true
  239. document.calc.display.value=decto(mem,carry)
  240. }

  241. function putmemory()
  242. {
  243. endNumber=true
  244. if (document.calc.display.value!=0)
  245. {
  246. mem=todec(document.calc.display.value,carry)
  247. document.calc.memory.value=" M "
  248. }
  249. else
  250. document.calc.memory.value="   "
  251. }

  252. function addmemory()
  253. {
  254. endNumber=true
  255. mem=parseFloat(mem)+parseFloat(todec(document.calc.display.value,carry))
  256. if (mem==0)
  257. document.calc.memory.value="   "
  258. else
  259. document.calc.memory.value=" M "
  260. }

  261. function multimemory()
  262. {
  263. endNumber=true
  264. mem=parseFloat(mem)*parseFloat(todec(document.calc.display.value,carry))
  265. if (mem==0)
  266. document.calc.memory.value="   "
  267. else
  268. document.calc.memory.value=" M "
  269. }

  270. //十进制转换

  271. function todec(num,oldcarry)
  272. {
  273. if (oldcarry==10 || num==0) return(num)
  274. var neg=(num.charAt(0)=="-")
  275. if (neg) num=num.substr(1)
  276. var newnum=0
  277. for (var index=1;index<=num.length;index++)
  278. newnum=newnum*oldcarry+hexnum.indexOf(num.charAt(index-1))
  279. if (neg)
  280. newnum=-newnum
  281. return(newnum)
  282. }

  283. function decto(num,newcarry)
  284. {
  285. var neg=(num<0)
  286. if (newcarry==10 || num==0) return(num)
  287. num=""+Math.abs(num)
  288. var newnum=""
  289. while (num!=0)
  290. {
  291. newnum=hexnum.charAt(num%newcarry)+newnum
  292. num=Math.floor(num/newcarry)
  293. }
  294. if (neg)
  295. newnum="-"+newnum
  296. return(newnum)
  297. }

  298. //表达式解析

  299. function parse(string)
  300. {
  301. if (string.match(/^(.*\d[\+\-\*\/\%\^\&\|x\<])?([+-]?[0-9a-f\.]+)([\+\-\*\/\%\^\&\|x\<])([+-]?[0-9a-f\.]+)$/))
  302. return(RegExp.$1+cypher(RegExp.$2,RegExp.$3,RegExp.$4))
  303. else
  304. return(string)
  305. }

  306. //数学运算和位运算

  307. function cypher(left,join,right)
  308. {
  309. left=todec(left,carry)
  310. right=todec(right,carry)
  311. if (join=="+")
  312. return(decto(parseFloat(left)+parseFloat(right),carry))
  313. if (join=="-")
  314. return(decto(left-right,carry))
  315. if (join=="*")
  316. return(decto(left*right,carry))
  317. if (join=="/"  &&  right!=0)
  318. return(decto(left/right,carry))
  319. if (join=="%")
  320. return(decto(left%right,carry))
  321. if (join=="&")
  322. return(decto(left&right,carry))
  323. if (join=="|")
  324. return(decto(left|right,carry))
  325. if (join=="^")
  326. return(decto(Math.pow(left,right),carry))
  327. if (join=="x")
  328. return(decto(left^right,carry))
  329. if (join=="<")
  330. return(decto(left<<right,carry))
  331. alert("除数不能为零")
  332. return(left)
  333. }

  334. //函数计算

  335. function funcalc(fun,num)
  336. {
  337. with(Math)
  338. {
  339. if (fun=="pi")
  340. return(PI)
  341. if (fun=="e")
  342. return(E)

  343. if (fun=="abs")
  344. return(abs(num))
  345. if (fun=="ceil")
  346. return(ceil(num))
  347. if (fun=="round")
  348. return(round(num))

  349. if (fun=="floor")
  350. return(floor(num))
  351. if (fun=="deci")
  352. return(num-floor(num))


  353. if (fun=="ln"  &&  num>0)
  354. return(log(num))
  355. if (fun=="exp")
  356. return(exp(num))
  357. if (fun=="log"  &&  num>0)
  358. return(log(num)*LOG10E)
  359. if (fun=="expdec")
  360. return(pow(10,num))


  361. if (fun=="cube")
  362. return(num*num*num)
  363. if (fun=="cubt")
  364. return(pow(num,1/3))
  365. if (fun=="sqr")
  366. return(num*num)
  367. if (fun=="sqrt"  &&  num>=0)
  368. return(sqrt(num))

  369. if (fun=="!")
  370. return(factorial(num))

  371. if (fun=="recip"  &&  num!=0)
  372. return(1/num)

  373. if (fun=="dms")
  374. return(dms(num))
  375. if (fun=="deg")
  376. return(deg(num))

  377. if (fun=="~")
  378. return(~num)

  379. if (angle=="d")
  380. {
  381. if (fun=="sin")
  382. return(sin(degressToRadians(num)))
  383. if (fun=="cos")
  384. return(cos(degressToRadians(num)))
  385. if (fun=="tan")
  386. return(tan(degressToRadians(num)))

  387. if (fun=="arcsin"  &&  abs(num)<=1)
  388. return(radiansToDegress(asin(num)))
  389. if (fun=="arccos"  &&  abs(num)<=1)
  390. return(radiansToDegress(acos(num)))
  391. if (fun=="arctan")
  392. return(radiansToDegress(atan(num)))
  393. }
  394. else
  395. {
  396. if (fun=="sin")
  397. return(sin(num))
  398. if (fun=="cos")
  399. return(cos(num))
  400. if (fun=="tan")
  401. return(tan(num))

  402. if (fun=="arcsin"  &&  abs(num)<=1)
  403. return(asin(num))
  404. if (fun=="arccos"  &&  abs(num)<=1)
  405. return(acos(num))
  406. if (fun=="arctan")
  407. return(atan(num))
  408. }

  409. if (fun=="hypsin")
  410. return((exp(num)-exp(0-num))*0.5)
  411. if (fun=="hypcos")
  412. return((exp(num)+exp(-num))*0.5)
  413. if (fun=="hyptan")
  414. return((exp(num)-exp(-num))/(exp(num)+exp(-num)))

  415. if (fun=="ahypsin" | fun=="hypcos" | fun=="hyptan")
  416. {
  417. alert("对不起,公式还没有查到!")
  418. return(num)
  419. }

  420. alert("超出函数定义范围")
  421. return(num)
  422. }
  423. }

  424. function factorial(n)
  425. {
  426. n=Math.abs(parseInt(n))
  427. var fac=1
  428. for (;n>0;n-=1)
  429. fac*=n
  430. return(fac)
  431. }

  432. function dms(n)
  433. {
  434. var neg=(n<0)
  435. with(Math)
  436. {
  437. n=abs(n)
  438. var d=floor(n)
  439. var m=floor(60*(n-d))
  440. var s=(n-d)*60-m
  441. }
  442. var dms=d+m/100+s*0.006
  443. if (neg)
  444. dms=-dms
  445. return(dms)
  446. }

  447. function deg(n)
  448. {
  449. var neg=(n<0)
  450. with(Math)
  451. {
  452. n=abs(n)
  453. var d=floor(n)
  454. var m=floor((n-d)*100)
  455. var s=(n-d)*100-m
  456. }
  457. var deg=d+m/60+s/36
  458. if (neg)
  459. deg=-deg
  460. return(deg)
  461. }

  462. function degressToRadians(degress)
  463. {
  464. return(degress*Math.PI/180)
  465. }

  466. function radiansToDegress(radians)
  467. {
  468. return(radians*180/Math.PI)
  469. }

  470. //界面

  471. //-->
  472. </script>
  473. </head>
  474. <!--written by GoldHuman li hai-->
  475. <!--2000.8-->
  476. <body>
  477. <div align="center">
  478. <form name=calc>
  479. <table border="1" width="500" height="250">
  480. <tr>
  481. <td height=50>
  482. <table width=500>
  483. <td width="133">
  484. </td>
  485. <td width="353">
  486. <div align=center>
  487. <input type=text name="display" value="0" readonly size="40">
  488. </div>
  489. </td>
  490. </table>
  491. </td>
  492. </tr>
  493. <tr>
  494. <td>
  495. <table width=500>
  496. <tr>
  497. <td width=290>
  498. <input type=radio name="carry" onClick="inputChangCarry(16)">
  499. 十六进制
  500. <input type=radio name="carry" checked onClick="inputChangCarry(10)">
  501. 十进制
  502. <input type=radio name="carry" onClick="inputChangCarry(8)">
  503. 八进制
  504. <input type=radio name="carry" onClick="inputChangCarry(2)">
  505. 二进制
  506. </td>
  507. <td>
  508. </td>
  509. <td width=135>
  510. <input type=radio name="angle" value="d" onClick="inputChangAngle('d')" checked>
  511. 角度制
  512. <input type=radio name="angle" value="r" onClick="inputChangAngle('r')">
  513. 弧度制
  514. </td>
  515. </tr>
  516. </table>
  517. <table width=500>
  518. <tr>
  519. <td width=170>
  520. <input name="shiftf" type="checkbox" onclick="inputshift()">上档功能
  521. <input name="hypf" type="checkbox" onclick="inputshift()">双曲函数
  522. </td>
  523. <td>
  524. <input name="bracket" value="" type=text size=3 readonly style="background-color=lightgrey">
  525. <input name="memory" value="" type=text size=3 readonly style="background-color=lightgrey">
  526. <input name="operator" value="" type=text size=3 readonly style="background-color=lightgrey">
  527. </td>
  528. <td width=183>
  529. <input type="button" value=" 退格 "
  530. onclick="backspace()" style="color=red">
  531. <input type="button" value=" 清屏 "
  532. onClick="document.calc.display.value = 0 " style="color=red">
  533. <input type="button" value=" 全清"
  534. onClick="clearall()" style="color=red">
  535. </td>
  536. </tr>
  537. </table>

  538. <table width=500>
  539. <tr>
  540. <td>
  541. <table>
  542. <tr  align=center>
  543. <td>
  544. <input name=pi type="button" value=" PI "
  545. onClick="inputfunction('pi','pi')" style="color=blue">
  546. </td>

  547. <td>
  548. <input name=e type="button" value=" E  "
  549. onClick="inputfunction('e','e')" style="color=blue">
  550. </td>

  551. <td>
  552. <input name=bt type="button" value="d.ms"
  553. onClick="inputfunction('dms','deg')" style="color=#ff00ff">
  554. </td>
  555. </tr>
  556. <tr  align=center>
  557. <td>
  558. <input  type="button" value=" (  "
  559. onClick="addbracket()" style="color=#ff00ff">
  560. </td>

  561. <td>
  562. <input  type="button" value=" )  "
  563. onClick="disbracket()" style="color=#ff00ff">
  564. </td>

  565. <td>
  566. <input name=ln type="button" value=" ln "
  567. onClick="inputfunction('ln','exp')" style="color=#ff00ff">
  568. </td>
  569. </tr>
  570. <tr  align=center>
  571. <td>
  572. <input name=sin type="button" value="sin "
  573. onClick="inputtrig('sin','arcsin','hypsin','ahypsin')" style="color=#ff00ff">
  574. </td>

  575. <td>
  576. <input  type="button" value="x^y "
  577. onClick="operation('^',7)" style="color=#ff00ff">
  578. </td>

  579. <td>
  580. <input name=log type="button" value="log "
  581. onClick="inputfunction('log','expdec')" style="color=#ff00ff">
  582. </td>
  583. </tr>
  584. <tr  align=center>
  585. <td>
  586. <input name=cos type="button" value="cos "
  587. onClick="inputtrig('cos','arccos','hypcos','ahypcos')" style="color=#ff00ff">
  588. </td>

  589. <td>
  590. <input name=cube type="button" value="x^3 "
  591. onClick="inputfunction('cube','cubt')" style="color=#ff00ff">
  592. </td>

  593. <td>
  594. <input  type="button" value=" n! "
  595. onClick="inputfunction('!','!')" style="color=#ff00ff">
  596. </td>
  597. </tr>
  598. <tr  align=center>
  599. <td>
  600. <input name=tan type="button" value="tan "
  601. onClick="inputtrig('tan','arctan','hyptan','ahyptan')" style="color=#ff00ff">
  602. </td>

  603. <td>
  604. <input name=sqr type="button" value="x^2 "
  605. onClick="inputfunction('sqr','sqrt')" style="color=#ff00ff">
  606. </td>

  607. <td>
  608. <input  type="button" value="1/x "
  609. onClick="inputfunction('recip','recip')" style="color=#ff00ff">
  610. </td>
  611. </tr>
  612. </table>
  613. </td>
  614. <td width=30>
  615. </td>
  616. <td>
  617. <table>
  618. <tr>
  619. <td>
  620. <input  type="button" value=" 储存 "
  621. onClick="putmemory()" style="color=red">
  622. </td>
  623. </tr>
  624. <td>
  625. <input  type="button" value=" 取存 "
  626. onClick="getmemory()" style="color=red">
  627. </td>
  628. </tr>
  629. <tr>
  630. <td>
  631. <input  type="button" value=" 累存 "
  632. onClick="addmemory()" style="color=red">
  633. </td>
  634. </tr>
  635. <tr>
  636. <td>
  637. <input  type="button" value=" 积存 "
  638. onClick="multimemory()" style="color=red">
  639. </td>
  640. </tr>
  641. <tr>
  642. <td height="33">
  643. <input  type="button" value=" 清存 "
  644. onClick="clearmemory()" style="color=red">
  645. </td>
  646. </tr>
  647. </table>
  648. </td>
  649. <td width=30>
  650. </td>
  651. <td>
  652. <table>
  653. <tr  align=center>
  654. <td>
  655. <input name=k7 type="button" value=" 7 "
  656. onClick="inputkey('7')" style="color=blue">
  657. </td>

  658. <td>
  659. <input name=k8 type="button" value=" 8 "
  660. onClick="inputkey('8')" style="color=blue">
  661. </td>

  662. <td>
  663. <input name=k9 type="button" value=" 9 "
  664. onClick="inputkey('9')" style="color=blue">
  665. </td>

  666. <td>
  667. <input  type="button" value=" / "
  668. onClick="operation('/',6)" style="color=red">
  669. </td>

  670. <td>
  671. <input  type="button" value="取余"
  672. onClick="operation('%',6)" style="color=red">
  673. </td>

  674. <td>
  675. <input  type="button" value=" 与 "
  676. onClick="operation('&',3)" style="color=red">
  677. </td>
  678. </tr>

  679. <tr  align=center>
  680. <td>
  681. <input name=k4 type="button" value=" 4 "
  682. onClick="inputkey('4')" style="color=blue">
  683. </td>

  684. <td>
  685. <input name=k5 type="button" value=" 5 "
  686. onClick="inputkey('5')" style="color=blue">
  687. </td>

  688. <td>
  689. <input name=k6 type="button" value=" 6 "
  690. onClick="inputkey('6')" style="color=blue">
  691. </td>

  692. <td>
  693. <input  type="button" value=" * "
  694. onClick="operation('*',6)" style="color=red">
  695. </td>

  696. <td>
  697. <input name=floor type="button" value="取整"
  698. onClick="inputfunction('floor','deci')" style="color=red">
  699. </td>

  700. <td>
  701. <input  type="button" value=" 或 "
  702. onClick="operation('|',1)" style="color=red">
  703. </td>
  704. </tr>

  705. <tr  align=center>
  706. <td>
  707. <input  type="button" value=" 1 "
  708. onClick="inputkey('1')" style="color=blue">
  709. </td>

  710. <td>
  711. <input name=k2 type="button" value=" 2 "
  712. onClick="inputkey('2')" style="color=blue">
  713. </td>

  714. <td>
  715. <input name=k3 type="button" value=" 3 "
  716. onClick="inputkey('3')" style="color=blue">
  717. </td>

  718. <td>
  719. <input  type="button" value=" - "
  720. onClick="operation('-',5)" style="color=red">
  721. </td>

  722. <td>
  723. <input  type="button" value="左移"
  724. onClick="operation('<',4)" style="color=red">
  725. </td>

  726. <td>
  727. <input  type="button" value=" 非 "
  728. onClick="inputfunction('~','~')" style="color=red">
  729. </td>
  730. </tr>

  731. <tr  align=center>
  732. <td>
  733. <input  type="button" value=" 0 "
  734. onClick="inputkey('0')" style="color=blue">
  735. </td>

  736. <td>
  737. <input  type="button" value="+/-"
  738. onClick="changeSign()" style="color=blue">
  739. </td>

  740. <td>
  741. <input name=kp type="button" value=" . "
  742. onClick="inputkey('.')" style="color=blue">
  743. </td>

  744. <td>
  745. <input  type="button" value=" + "
  746. onClick="operation('+',5)" style="color=red">
  747. </td>

  748. <td>
  749. <input  type="button" value=" = "
  750. onClick="result()" style="color=red">
  751. </td>

  752. <td>
  753. <input  type="button" value="异或"
  754. onClick="operation('x',2)" style="color=red">
  755. </td>
  756. </tr>

  757. <tr  align=center>
  758. <td>
  759. <input name=ka type="button" value=" A "
  760. onClick="inputkey('a')" style="color=blue" disabled=true>
  761. </td>

  762. <td>
  763. <input name=kb type="button" value=" B "
  764. onClick="inputkey('b')" style="color=blue" disabled=true>
  765. </td>

  766. <td>
  767. <input name=kc type="button" value=" C "
  768. onClick="inputkey('c')" style="color=blue" disabled=true>
  769. </td>

  770. <td>
  771. <input name=kd type="button" value=" D "
  772. onClick="inputkey('d')" style="color=blue" disabled=true>
  773. </td>

  774. <td>
  775. <input name=ke type="button" value=" E?"
  776. onClick="inputkey('e')" style="color=blue" disabled=true>
  777. </td>

  778. <td>
  779. <input name=kf type="button" value=" F?"
  780. onClick="inputkey('f')" style="color=blue" disabled=true>
  781. </td>
  782. </tr>
  783. </table>
  784. </td>
  785. </tr>
  786. </table>
  787. </td>
  788. </tr>
  789. </table>
  790. </form>
  791. </div>
  792. </body>
  793. </html>
复制代码
科学计算器
免责声明:用户在本平台发表的内容(如有图片或视频亦包括在内)仅表明其个人观点,不代表本平台观点,本平台亦不承担任何法律及连带责任,本平台仅提供信息存储服务;本平台发布的信息仅为传递、参考之用,不构成任何投资、使用等行为的建议。任何后果均由用户自行承担;转载文章的版权归原作者所有,如有侵权,请与我们取得联系,我们将立即整改或删除相关内容。
回复 支持 反对

使用道具 举报

使用高级回帖 (可批量传图、插入视频等)快速回复

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则   Ctrl + Enter 快速发布  

发帖时请遵守我国法律,网站会将有关你发帖内容、时间以及发帖IP地址等记录保留,只要接到合法请求,即会将信息提供给有关政府机构。
关闭
快速回复 返回顶部 返回列表