JavaScript 寫時鍾日曆[1]

[入库:2005年8月18日] [更新:2007年3月24日]

本文简介:选择自 dewin 的 blog

另一穘日曆寫法!

效率很不錯的哦。

 

 

<!--
http://dwin.net
http://dewin.tk

copyright(c) 1998-2004 dewin all rights reserved

start 2003-06-21 00:08
finish 2003-06-22 02:50 calendar
finish 2003-06-22 15:35 time
finish 2003-06-22 18:55 second edit
finish 2003-06-23 02:49 last edit
finish 2003-06-25 10:10 emu <select>
-->
<script>var nowtime = new date().valueof()</script>
<html xmlns:v>
<style>
v\:*{behavior:url(#default#vml)}
</style>


<body>
<v:group coordorigin="0,0" coordsize="360,180" onmouseover=heightlight() onmouseout=heightlight() style='position:absolute;left:20;top:60;width:360;height:180'>
 <v:roundrect style='position:absolute;left:0;top:0;width:180;height:180' fillcolor='white' strokecolor='#d0d0bf'>
  <input id='iyears' style='position:absolute;left:53%;top:10%;width:33%;height:11%;overflow:hidden;font-size:9pt;border:1 solid #7f9db9' onkeydown='if(event.keycode==13)showdate(this.value,imonths.selectedindex)'>
  <span onmouseover='this.filters.alpha.opacity=70' onmouseout='this.filters.alpha.opacity=100' style='position:absolute;left:87%;top:10%;width:9%;height:5%;background:#ffd000;overflow:hidden;filter:alpha(opacity=100);font-size:7pt;text-align:center;color:white' onclick=showdate(++iyears.value,imonths.selectedindex)>▲</span>
  <span onmouseover='this.filters.alpha.opacity=70' onmouseout='this.filters.alpha.opacity=100' style='position:absolute;left:87%;top:16%;width:9%;height:5%;background:#ffd000;overflow:hidden;filter:alpha(opacity=100);font-size:8pt;text-align:center;color:white' onclick=showdate(--iyears.value,imonths.selectedindex)>▼</span>
  <span style='position:absolute;left:5%;top:26%;width:90%;height:66%;border-left:1 inset #716f64;border-top:1 inset #716f64;border-right:1 inset #f1efe2;border-bottom:1 inset #f1efe2;overflow:hidden'>
   <table style='position:absolute;left:0;top:0;width:100%;height:12%;color:#d8e4f8;background:#7a96df;font-size:9pt;text-align:center'><tr><td>s</td><td>m</td><td>t</td><td>w</td><td>t</td><td>f</td><td>s</td></tr></table>
   <span id='icalendar' onclick=if(event.srcelement.nodename=="span")daychoose(parseint(event.srcelement.innerhtml)) style='position:absolute;left:0;top:18%;width:200%;height:82%'>
   <script>
   /*
   for(i=0;i<6;i++)document.write(",&nbsp;")
   for(i=1;i<56;i++) document.write((i+5)%13==0?"<br>,"+(i-6*parseint((i+5)/13)):","+(i-6*parseint((i+5)/13)))

   */

   /* calendar html start */
   var ihtml=""
   for(i=1;i<=31;i++){
    ihtml+="<td><span>"+i+"</span></td>"
    if(i%7==0)ihtml+="</tr><tr>"
    }
   ihtml+="</tr></table>"
   document.write("<table style='position:absolute;left:0;top:17%;width:50%;height:85%;font-size:9pt;text-align:center;' cellspacing=0><tr>"+ihtml+"<table style='position:absolute;left:50%;top:0;width:50%;height:85%;font-size:9pt;text-align:center;' cellspacing=0><tr>"+ihtml)
   /* calendar html end */

   datearray = []
   for(i=0;i<31;i++){//collect days <td> to an array
    datearray[i*2]=icalendar.childnodes[1].rows[parseint(i/7)].cells[i%7].firstchild
    datearray[i*2+1]=icalendar.childnodes[2].rows[parseint(i/7)].cells[i%7].firstchild
    }
   </script>
   </span>
  </span>

  <!-- emu the <select> start -->
  <div style='position:absolute;left:5%;top:10%;width:44%;height:11%;border:1 solid #7f9db9;font-size:9pt' onclick=imonths.style.display=(imonths.style.display=='none')?'block':'none'>
   <input style='position:absolute;left:0;top:0;width:100%;height:100%;border:0;font-size:9pt'>
   <span onmouseover='this.filters.alpha.opacity=70' onmouseout='this.filters.alpha.opacity=100' style='position:absolute;right:0;top:0;width:25%;height:100%;background:#87cefa;filter:alpha(opacity=100);'><span style='position:absolute;top:30%;width:100%;height:100%;text-align=center;color:white'>▼</span></span>

本文关键:日曆,日历,javascript,jscript,dewin,dwin,js
  相关方案
Google
 

本站最佳浏览方式为 分辨率 1024x768 IE 6.0(或更高版本的 IE浏览器)

go top