日本語
<!-- 保存元 url=http://www.downcodes.com/js --> <!-- Web デザイン bbs url=http://www.downcodes.com/bbs--> <!--必須これを完了するには 2 つの手順が必要です。最初の手順は、次のコードを <head> 領域に追加することです --> <STYLE TYPE="text/css"> .normal{BACKGROUND: #ffffff} .today {font- Weight:bold; 背景: #6699cc} .satday{color:green} .sunday{color:red} .days {font-weight:bold} </STYLE> <SCRIPT LANGUAGE="JavaScript"> var months = new Array( 「1月」、「2月」、「3月」、「4月」、「5月」、「6月」、「7月」、「8月」、「9月」、「10月」、「11月」、「12月」); var daysInMonth = new Array(31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31) /*var days = new Array("Sunday", "Monday", " Tuesday"); , "水曜日", "木曜日", "金曜日", "土曜日");*/ var days = new Array("日","一", "二", "三" , "四", "五", "6"); function getDays(month, year) { if (1 == 月) return ((0 == 年 % 4) && (0 != (年 % 100)) ) || 400) ? 29 : 28; else return daysInMonth[month]; } function getToday() { //今日の年、月、日を取得します this.now = new Date() this. ; this.month = this.now.getMonth(); this.day = this.now.getDate(); } 今日 = new getToday(); 今日 = new getToday(); document.all.year [document.all.year.selectedIndex].text); var newCal = new Date(parseyear, document.all.month.selectedIndex, 1); var day = - 1; ); var daily = 0; if ((today.year == newCal.getFull Year()) &&(today.month == newCal.getMonth())) day = today.day; tBodies.dayList; var intDaysInMonth =getDays(newCal.getMonth(), newCal.getFull Year()); 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 if(day) ==daily) //今日、今日のクラスを呼び出します 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++; "; } } function getDate() { var sDate; //このコードはマウスクリックを処理します if ("TD" ==event.srcElement.tagName) if (" " !=event.srcElement.innerText) { sDate = document.all .year.value + "年" + document.all.month.value + "月" + events.srcElement.innerText + "日" } } </SCRIPT> <input type="hidden" ; ="ret"> <TABLE ID="calendar" cellpacing="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 ? "選択済み" : "") + ">" + intLoop); </SCRIPT> </SELECT> </TD> </TR> <TR CLASS="days"> <SCRIPT LANGUAGE ="JavaScript"> document.write("<TD class=satday>" + days[0] + "</TD>"); (var intLoop = 1; intLoop < days.length-1; intLoop++) ドキュメント。 write("<TD>" + days[intLoop] + "</TD>"); document.write("<TD class=sunday>" + days[intLoop] + "</SCRIPT"); > </TR> </THEAD> <TBODY border=1 cellpacing="0" cellpadding="0" ID="dayList"ALIGN=CENTER ONCLICK=" getDate()"> <SCRIPT LANGUAGE="JavaScript"> for ( var intWeeks = 0; intWeeks < 6; intWeeks++) { document.write("<TR style='cursor:hand'>"); for (var intDays = 0; intDays < days.length; intDays++) <TD></TD>"); document.write("</TR>"); } </SCRIPT> </TBODY> </TABLE> <div align="center"></div> <div align ="center"> <Script Language="JavaScript1.2"> function Cancel() { document.all.ret.value = ""; window.close( ); </script> </div> <!--ステップ 2: 「OnUnload="window.returnValue = document.all.ret.value;"」を <body> タグに追加します。例: --> <body OnUnload="window.returnValue = document.all.ret。値;">