爱易网
IT新闻
IT新闻
爱易资讯
网站搭建
云虚拟主机教程
云服务器教程
Apache教程
IIS教程
Nginx教程
网站策划
站长文章
推广教程
淘宝客教程
网页设计
HTML教程
XHTML教程
CSS教程
HTML5教程
CSS3教程
JavaSript基础
JQuery教程
Node.js教程
前端技术
Ajax教程
Js特效
Xml教程
平面设计
页面UI设计
photoshop教程
程序开发
AI人工智能
Asp教程
Php教程
Asp.Net教程
Net Core教程
C#教程
Java教程
Jsp教程
开发技术
微信小程序教程
Uniapp开发教程
微信公众号开发
Andriod教程
IOS教程
DOS教程
Python教程
Docker教程
Windows Container教程
数据库
MSSQL教程
MySQL教程
Redis教程
Access教程
Oracle教程
数据库教程
操作系统
Linux教程
Windows教程
MAC教程
Cisco教程
交换机教程
防火墙教程
搜索
爱易网页
JS特效
又一款新颖的万年历
又一款新颖的万年历
日期:2014-05-18 浏览次数:20123 次
欢迎光临爱易网网页脚本特效中心,点击运行按钮演示特效:
以下是程序代码
有什么问题请到<a href='/bbs/index.asp?boardid=2'>论坛</a>中发表<br> <!-- Saved From url=http://www.aiyiweb.com/js --> <!-- Web Design bbs url=http://www.aiyiweb.com/bbs--> <!--要完成此需要两个步骤 第一步:把如下代码加入到<head>区域中--> <STYLE TYPE="text/css"> .normal{BACKGROUND: #ffffff} .today {font-weight:bold;BACKGROUND: #6699cc} .satday{color:green} .sunday{color:red} .days {font-weight:bold} </STYLE> <SCRIPT LANGUAGE="JavaScript"> var months = new Array("一月", "二月", "三月", "四月", "五月", "六月", "七月", "八月", "九月", "十月", "十一月", "十二月"); var daysInMonth = new Array(31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31); /*var days = new Array("Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday");*/ var days = new Array("日","一", "二", "三", "四", "五", "六"); function getDays(month, year) { if (1 == month) return ((0 == year % 4) && (0 != (year % 100))) || (0 == year % 400) ? 29 : 28; else return daysInMonth[month]; } function getToday() { //得到今天的年,月,日 this.now = new Date(); this.year = this.now.getFullYear(); this.month = this.now.getMonth(); this.day = this.now.getDate(); } today = new getToday(); function newCalendar() { today = new getToday(); var parseYear = parseInt(document.all.year [document.all.year.selectedIndex].text); var newCal = new Date(parseYear, document.all.month.selectedIndex, 1); var day = -1; var startDay = newCal.getDay(); var daily = 0; if ((today.year == newCal.getFullYear()) &&(today.month == newCal.getMonth())) day = today.day; var tableCal = document.all.calendar.tBodies.dayList; var intDaysInMonth =getDays(newCal.getMonth(), newCal.getFullYear()); for (var intWeek = 0; intWeek < tableCal.rows.length;intWeek++) for (var intDay = 0;intDay < tableCal.rows[intWeek].cells.length;intDay++) { var cell = tableCal.rows[intWeek].cells[intDay]; if ((intDay == startDay) && (0 == daily)) daily = 1; if(day==daily) //今天,调用今天的Class cell.className = "today"; else if(intDay==6) //周六 cell.className = "sunday"; else if (intDay==0) //周日 cell.className ="satday"; else //平常 cell.className="normal"; if ((daily > 0) && (daily <= intDaysInMonth)) { cell.innerText = daily; daily++; } else cell.innerText = ""; } } function getDate() { var sDate; //这段代码处理鼠标点击的情况 if ("TD" == event.srcElement.tagName) if ("" != event.srcElement.innerText) { sDate = document.all.year.value + "年" + document.all.month.value + "月" + event.srcElement.innerText + "日"; alert(sDate); } } </SCRIPT> <input type="hidden" name="ret"> <TABLE ID="calendar" cellspacing="0" cellpadding="0" border=1 align="center"> <THEAD> <TR> <TD COLSPAN=7 ALIGN=CENTER> <SELECT ID="month" ONCHANGE="newCalendar()"> <SCRIPT LANGUAGE="JavaScript"> for (var intLoop = 0; intLoop < months.length; intLoop++) document.write("<OPTION VALUE= " + (intLoop + 1) + " " + (today.month == intLoop ? "Selected" : "") + ">" + months[intLoop]); </SCRIPT> </SELECT> <SELECT ID="year" ONCHANGE="newCalendar()"> <SCRIPT LANGUAGE="JavaScript"> for (var intLoop = today.year-100; intLoop < (today.year + 64); intLoop++) document.write("<OPTION VALUE= " + intLoop + " " + (today.year == intLoop ? "Selected" : "") + ">" + intLoop); </SCRIPT> </SELECT> </TD> </TR> <TR CLASS="days"> <SCRIPT LANGUAGE="JavaScript"> document.write("<TD class=satday>" + days[0] + "</TD>"); for (var intLoop = 1; intLoop < days.length-1; intLoop++) document.write("<TD>" + days[intLoop] + "</TD>"); document.write("<TD class=sunday>" + days[
上一篇:狡猾的按钮特效
下一篇:Showdate函数来显示各种英文日期
免责声明:
本文仅代表作者个人观点,与爱易网无关。其原创性以及文中陈述文字和内容未经本站证实,对本文以及其中全部或者部分内容、文字的真实性、完整性、及时性本站不作任何保证或承诺,请读者仅作参考,并请自行核实相关内容。
相关资料
更多>
罗永浩工匠形象坍塌,锤子产能再跳水逃离用户超两成
奇虎360证明了“惟平台化才能生存”是谬论,中国互联网不能少了周鸿祎
微软谷歌高层访韩面前:忌惮三星的崛起
充斥着假消息负能量的“秘密”缺乏普适性
乐视28日发布手机进展 LeUI系统Mobile版或曝光
空气污染器市场乱象丛生 选购需慎重
《中国三网融合业务运营管理》研讨报告征订函
创维冲击500亿梦想:转型硬件和内容供应商
谷歌董事长成花花公子:情史足以媲美涂鸦
推荐阅读
更多>
富士康欲用机器人产iPhone 6
传诺基亚5月14日发布会推出Lumia 950
FDD牌照短期不会发放 联通电信暗自提速建网
华为变阵:任正非调整三大业务布局
陈天桥之鉴:产品创新被扼杀那些事
微软与摩托罗拉授权协议涵盖Android和Chrome设备
三星起诉LG在冰箱广告中玷污其企业笼统
微软为避免代理权争夺 与大股东达成和解协议
英特尔涉嫌垄断 欧盟或开出史上最高罚单
高德百度地图免费背后:李彦宏暗斗马云周鸿祎
苹果6月20日发布iPhone5S 触摸屏概念股生动
史玉柱此刻离任:营销巨匠为新游戏炒作?
英特尔承认,联想最新K系列智能手机放弃英特尔处理器
支付宝被曝严重破绽 隐私平安再受质疑
广电地方营业厅的一句“罚停”,暴露出了他们的本质
云储存有多远:跨过数据安全问题即可到达
阿里入股虎嗅:媒体的脊梁弯了?未必!
盘点改变社会的15种科技:谷歌眼镜将使我们成为半机械人
华为美国推出电商网站 发售Mate 2LTE版
Skype周年:与微软联姻到底有没有未来?