HTML组件之:编写日历(2)

2016-01-29 12:08 16 1 收藏

HTML组件之:编写日历(2),HTML组件之:编写日历(2)

【 tulaoshi.com - Html 】

===编写日历一===

如果指定的年数可以被4整除,那么leapYear()函数将返回“true”,否则返回”false“:

function leapYear(year) {
if (year % 4 == 0) // basic rule
return true; // is leap year
/* else */ // else not needed when statement is "return"
return false; // is not leap year
}
getMonthName()函数返回指定月份的名字:
function getMonthName(month) {
// create array to hold name of each month
var ar = new Array(12);
ar[0] = "January";
ar = "February";
ar = "March";
ar = "April";
ar = "May";
ar = "June";
ar = "July";
ar = "August";
ar = "September";
ar = "October";
ar = "November";
ar = "December";

// return name of specified month (parameter)
return ar[month];
}

(本文来源于图老师网站,更多请访问http://www.tulaoshi.com/html/)

来源:http://www.tulaoshi.com/n/20160129/1484763.html

延伸阅读
  ===TODAY HTC=== <HEAD <PUBLIC:COMPONENT tagName="DAY" <PROPERTY NAME="value"</PROPERTY <ATTACH EVENT="oncontentready" ONEVENT="fnInit()"</ATTACH </PUBLIC:COMPONENT <STYLE .clsDay { width:50; height:50; background-color: pink; align:center; text-align:right; } </STYLE <SCRIPT L...
===ANYDAY 和 TODAY HTCs=== 样式类 clsDay 定义在该页的别处: <STYLE .clsDay { width:50; height:50; background-color:lightyellow; align:center; text-align:right; } </STYLE 注意在日历中日期的被填色为亮黄色,这证明HTC的格式的指定模式被它的调用者所支配,即:calendar.htc. fninit()的第三行设置...
  ====日历主页面=== <head <titleCalendar Example</title <?IMPORT NAMESPACE="MYCAL" IMPLEMENTATION="calendar.htc"/ </HEAD <BODY <PClick a day in the calendar to add or modify your schedule.</P <MYCAL:CALENDAR</MYCAL:CALENDAR </BODY </HTML ===CALENDAR HTC=== <HEAD...
  ====日历主页面=== <head <titleCalendar Example</title <?IMPORT NAMESPACE="MYCAL" IMPLEMENTATION="calendar.htc"/ </HEAD <BODY <PClick a day in the calendar to add or modify your schedule.</P <MYCAL:CALENDAR</MYCAL:CALENDAR </BODY </HTML ===CALENDAR HTC=== <HEAD...
===CALENDAR HTC=== <HEAD <?IMPORT NAMESPACE="ANYDAY" IMPLEMENTATION="day.htc"/ <?IMPORT NAMESPACE="TODAY" IMPLEMENTATION="today.htc"/ <PUBLIC:COMPONENT tagName="CALENDAR" <ATTACH EVENT="oncontentready" ONEVENT="fnInit()"/ </PUBLIC:COMPONENT <SCRIPT LANGUAGE="JavaScript" <!-- function...

经验教程

457

收藏

66
微博分享 QQ分享 QQ空间 手机页面 收藏网站 回到头部