|
| |
精品推荐 |
 |
|
| |
|
|
|
|
几个日期特效的代码
|
日期:2007年7月23日 作者: 查看:[大字体
中字体 小字体]
|
} str += "</select>"; return str; } //private this.drawDate = function() { var str = ""; var fDay = new Date(this.year,this.month,1).getDay(); var fDate = 1-fDay; var lDay = new Date(this.year,this.month+1,0).getDay(); var lDate = new Date(this.year,this.month+1,0).getDate(); str += "<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\" id=\""+this.fName+"_dateTable"+"\">"; for (var I=1,j=fDate;I<7;I++) { str += "<tr>"; for (var k=0;k<7;k++) { str += "<td><span"+(j==this.date?" class=\"selected\"":"")+" onclick=\""+this.name+".redrawDate(this.innerText)\">"+(isDate(j++))+"</span></td>"; } str += "</tr>"; } str += "</table>"; return str;
function isDate(n) { return (n>=1&&n<=lDate)?n:""; } } //public this.redrawDate = function(d) { this.year = document.getElementById(this.fName+"_year").value; this.month = document.getElementById(this.fName+"_month").value-1; this.date = d this.date; document.getElementById(this.fName+"_year").value = this.year; document.getElementById(this.fName+"_month").selectedIndex = this.month; document.getElementById(this.fName+"_date").value = this.date; if (this.date>new Date(this.year,this.month+1,0).getDate()) this.date = new Date(this.year,this.month+1,0).getDate(); document.getElementById(this.fName+"_dateTable").outerHTML = this.drawDate(); } //public this.getDate = function(delimiter) { if (!delimiter) delimiter = "/"; var aValue = [this.year,(this.month+1),this.date]; return aValue.join(delimiter); } } </script> <table border="0"> <tr><td> <fieldset class="c_fieldset"><legend class="c_legend">日期(T)</legend> <!-- 调用日历 --> <script> var c = new calendar("c"); document.write?; </script> <!-- 调用日历 --> </fieldset> </td> <td valign="top"> <fieldset class="m_fieldset"><legend class="m_legend">时间(T)</legend> <!-- 调用时间钟 --> <script> var m = new minute("m"); m.play(); document.write(m); </script> <!-- 调用时间钟 --> </fieldset> </td></tr> <tr> <td colspan="2"> <button onclick="alert(c.getDate())" style="font:8px Webdings;width:15px;height:15px;line-height:6px;">4</button> <button style="font:10px Arial;height:15px;height:16px;border:0px;" onfocus="this.blur()">GetDate</button>
上一篇:揭开Windows网络邻居的内幕秘密
下一篇:3G的“软价值”不容忽视
|
| 几个日期特效的代码 相关文章: |
|
|
|
| 几个日期特效的代码 相关软件: |
|
|
|
|