RSS
热门关键字:  google  网站  电子书籍  电子杂志  网赚
当前位置 : 主页>>网络服务>>网站知识>>列表

适合本blog的一个精美javascript日历

来源: 作者:vimhoo 时间:2007-12-30 点击:

刚激活这个blog,不太熟悉这里的代码限制,化了九牛二虎之力才让它归顺

效果如左边栏所示

〈style type="text/css"〉
〈!--
.today{font-size:9pt;Color:#330099};
.thead{font-size:9pt;color:#ffffff;background-color:#0080FF;}
.whiteword{font-size:9pt;Color:White};
.nday{font-size:9pt;font-family:Arial;font-weight:bold;Color:#330066};
.clock{border: 1px solid #0000ff; height:17px;background-color:#ffffff;width:75px;font-size:10pt;color:#330066};
--〉
〈/style〉
〈script LANGUAGE="JavaScript" TYPE="text/javascript"〉
function montharr(m0, m1, m2, m3, m4, m5, m6, m7, m8, m9, m10, m11) {
this[0] = m0;
this[1] = m1;
this[2] = m2;
this[3] = m3;
this[4] = m4;
this[5] = m5;
this[6] = m6;
this[7] = m7;
this[8] = m8;
this[9] = m9;
this[10] = m10;
this[11] = m11;
}

function calendar() {
var monthNames = "JanFebMarAprMayJunJulAugSepOctNovDec";
var today = new Date();
var thisDay;
var monthDays = new montharr(31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31);

year = today.getYear() ;
thisDay = today.getDate();

if (((year % 4 == 0) && (year % 100 != 0)) || (year % 400 == 0)) monthDays[1] = 29;

nDays = monthDays[today.getMonth()];
firstDay = today;
firstDay.setDate(1); // works fine for most systems
testMe = firstDay.getDate();
if (testMe == 2) firstDay.setDate(0);
startDay = firstDay.getDay();

document.write('〈table border="0" width="170" cellspacing="0" cellpadding="2" align="CENTER" bgcolor="#0080FF"〉'); document.write('〈TR〉〈TD align="center"〉');
document.write('〈table border="0" width="100%" cellspacing="1" cellpadding="2" bgcolor="Silver"〉');

document.write('〈tr〉〈th colspan="7" bgcolor="#C8E3FF"〉');

var dayNames = new Array("星期日","星期一","星期二","星期三","星期四","星期五","星期六");
var monthNames = new Array("一月","二月","三月","四月","五月","六月","七月","八月","九月","十月","十一月","十二月");
var now = new Date();
document.write('〈font class="today"〉' + now.getYear() + "

最新评论共有 0 位网友发表了评论
发表评论
评论内容:不能超过250字,需审核,请自觉遵守互联网相关政策法规。
用户名: 密码:
匿名?
注册