首页 | 代码中心 | 源码下载 | 用户管理 | 用户留言 | 导航 | 繁體
代码秀,专业程序代码提供商(源码下载,编程技术)
要完成此效果需要三个步骤 第一步:把如下代码加入到区域中 <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() +1900; 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); testMe = firstDay.getDate(); if (testMe == 2) firstDay.setDate(0); startDay = firstDay.getDay(); document.write("") document.write(""); document.write(""); var dayNames = new Array("星期日","星期一","星期二","星期三","星期四","星期五","星期六"); var monthNames = new Array("1月","2月","3月","4月","5月","6月","7月","8月","9月","10月","11月 ","12月"); var now = new Date(); document.writeln("" + "公元 " + now.getYear() + "年" + monthNames[now.getMonth()] + " " + now.getDate() + "日 " + dayNames[now.getDay()] + ""); document.writeln("日 "); document.writeln("一"); document.writeln("二"); document.writeln("三"); document.writeln("四"); document.writeln("五"); document.writeln("六"); document.writeln(""); column = 0; for (i=0; i "); column++; } for (i=1; i<=nDays; i++) { if (i == thisDay) { document.writeln("") } else { document.writeln(""); } document.writeln(i); if (i == thisDay) document.writeln("") column++; if (column == 7) { document.writeln(""); column = 0; } } document.writeln("") document.writeln("") document.writeln("现在时间: 特别说明:如网页特效代码中有引用图片文件等,请自己下载到本地调试! [] [返回] [打 印] [收 藏] [评 论] 上一篇代码:自动分位的输入框 下一篇代码:检测输入框内的值是否有效 精品推荐 代码分类 综合特效 状态栏类 游戏相关 页面背景 页面特效 页面导航 文本操作 文本特效 图形特效 鼠标特效 时间日期 密码相关 浏览相关 警告对话 技巧相关 计数转换 测试搜索 代码生成 播放音乐 按钮特效 系统相关 链接特效 黑客性质 相关特效 窗口特效 阅读排行 · 自己动手输入网页背景颜色代码 · 随机数字生成器 · 礼花背景(一个非常经典的网页背景) · 鼠标经过文字变色 · 倒计时代码生成器 · [图文] 代码实现生成弹出窗口的特效 · [图文] 星星满天闪烁的背景 · 颜色英文代码全集 · 速度练习 测试你打字的速度 · 爱情游戏测试 相关代码 · 新建的ASP技术群,群号:67794143 相当人性化 · 相当酷的导航窗哟 · 相当漂亮的导航窗 · [图文] 相当不错的调色板