一个js写的日历(代码部分网摘)(2)


<div>
<div>&lt;&lt;</div>
<div>&gt;&gt;</div>
<span></span>年 <span></span>月
<table cellspacing="0">
<thead>
<tr>
<td>日</td>
<td>一</td>
<td>二</td>
<td>三</td>
<td>四</td>
<td>五</td>
<td>六</td>
</tr>
</thead>
<tbody>
</tbody>
</table>
</div>
<div ><!-- 通过id获取样式 -->
<input type="button" value="上一年" />
<input type="button" value="当前月" />
<input type="button" value="下一年" />
</div>
<script language="JavaScript">
var cale = new Calendar("idCalendar", {
onToday: function(o){ o.className = "onToday"; },
onFinish: function(){
$("idCalendarYear").innerHTML = this.Year; $("idCalendarMonth").innerHTML = this.Month;
}
});
$("idCalendarPre").onclick = function(){ cale.PreMonth(); }
$("idCalendarNext").onclick = function(){ cale.NextMonth(); }
$("idCalendarPreYear").onclick = function(){ cale.PreYear(); }
$("idCalendarNextYear").onclick = function(){ cale.NextYear(); }
$("idCalendarNow").onclick = function(){ cale.NowMonth(); }
</script>
</div>

您可能感兴趣的文章:

内容版权声明:除非注明,否则皆为本站原创文章。

转载注明出处:https://www.heiqu.com/wjyfyf.html