HTML 구성요소 7부
===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> <SCR<a href="http://ip.knowsky.com/">ip</a>T LANGUAGE="<a href="http://www.knowsky.com/article.asp?typeid=160">java</a>Script"> <!-- function fnInit() { defaults.viewLink = document; } // --> </SCRIPT> <STYLE> TD { background-color:tan; width:50; height:50; } </STYLE> </HEAD> <BODY> <SCRIPT LANGUAGE="<a href="http://www.knowsky.com/article.asp?typeid=36">Javascript</a>"> <!-- // Copyright 1997 -- Tomer Shiran setCal(); 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 } function getDays(month, year) { // create array to hold number of days in each month var ar = new Array(12); ar[0] = 31; // January ar[1] = (leapYear(year)) ? 29 : 28; // February ar[2] = 31; // March ar[3] = 30; // A<a href="http://pr.knowsky.com/">PR</a>il ar[4] = 31; // May ar[5] = 30; // June ar[6] = 31; // July ar[7] = 31; // August ar[8] = 30; // September ar[9] = 31; // October ar[10] = 30; // November ar[11] = 31; // December // return number of days in the specified month (parameter) return ar[month]; } function getMonthName(month) { // create array to hold name of each month var ar = new Array(12); ar[0] = "January"; ar[1] = "February"; ar[2] = "March"; ar[3] = "April"; ar[4] = "May"; ar[5] = "June"; ar[6] = "July"; ar[7] = "August"; ar[8] = "September"; ar[9] = "October"; ar[10] = "November"; ar[11] = "December"; // return name of specified month (parameter) return ar[month]; } function setCal() { // standard time attributes var now = new Date(); var year = now.getFullYear(); var month = now.getMonth(); var monthName = getMonthName(month); var date = now.getDate(); now = null; // create instance of first day of month, and extract the day on which it occurs var firstDayInstance = new Date(year, month, 1); var firstDay = firstDayInstance.getDay(); firstDayInstance = null; // number of days in current month var days = getDays(month, year); // call function to draw calendar drawCal(firstDay + 1, days, date, monthName, year); } function drawCal(firstDay, lastDate, date, monthName, year) { // constant table settings //var headerHeight = 50 // height of the table's header cell var border = 2; // 3D height of table's border var cellspacing = 4; // width of table's border var headerColor = "midnightblue"; // color of table's header var headerSize = "+3"; // size of tables header font var colWidth = 60; // width of columns in table var dayCellHeight = 25; // height of cells containing days of the week var dayColor = "darkblue"; // color of font representing week days var cellHeight = 40; // height of cells representing dates in the calendar var todayColor = "red"; // color specifying today's date in the calendar var timeColor = "purple"; // color of font representing current time // create basic table structure var text = ""; // initialize accumulative variable to empty string text += '<TABLE BORDER=' + border + ' CELLSPACING=' + cellspacing + '>'; // table settings text += '<TH COLSPAN=7 HEIGHT=' + 10 + '>'; // create table header cell text += '<FONT COLOR="' + headerColor + '" SIZE=' + headerSize + '>'; // set font for table header text += monthName + ' ' + year; text += '</FONT>'; // close table header's font settings text += '</TH>'; // close header cell // variables to hold constant settings var openCol = '<TD WIDTH=' + colWidth + ' HEIGHT=' + dayCellHeight + '>'; openCol += '<FONT COLOR="' + dayColor + '">'; var closeCol = '</FONT></TD>'; // create array of abbreviated day names var weekDay = new Array(7); weekDay[0] = "Sun"; weekDay[1] = "Mon"; weekDay[2] = "Tues"; weekDay[3] = "Wed"; weekDay[4] = "Thu"; weekDay[5] = "Fri"; weekDay[6] = "Sat"; // create first row of table to set column width and specify week day text += '<TR ALIGN="center" VALIGN="center">'; for (var dayNum = 0; dayNum < 7; ++dayNum) { text += openCol + weekDay[dayNum] + closeCol; } text += '</TR>'; // declaration and initialization of two variables to help with tables var dayOfMonth = 1; var curCell = 1; for (var row = 1; row <= Math.ceil((lastDate + firstDay - 1) / 7); ++row) { text += '<TR ALIGN="right" VALIGN="top">'; for (var col = 1; col <= 7; ++col) { if ((curCell < firstDay) || (dayOfMonth > lastDate)) { text += '<TD></TD>'; curCell++ } else { if (dayOfMonth == date) { // current cell represents today's date text += '<TD><TODAY:DAY value=' + dayOfMonth + '></TODAY:DAY></TD>'; } else { text += '<TD><ANYDAY:DAY value=' + dayOfMonth + '></ANYDAY:DAY></TD>'; } dayOfMonth++; } } text += '</TR>'; } // close all basic table tags text += '</TABLE>'; text += '</CENTER>'; // print accumulative HTML string document.write(text); } // --> </SCRIPT> </BODY> </HTML>
위 내용은 7번째 HTML 컴포넌트(HTML COMPONENTS) 내용입니다. 더 많은 관련 글은 PHP 중국어 홈페이지(www.kr)를 참고해주세요. .php.cn)!

핫 AI 도구

Undresser.AI Undress
사실적인 누드 사진을 만들기 위한 AI 기반 앱

AI Clothes Remover
사진에서 옷을 제거하는 온라인 AI 도구입니다.

Undress AI Tool
무료로 이미지를 벗다

Clothoff.io
AI 옷 제거제

AI Hentai Generator
AI Hentai를 무료로 생성하십시오.

인기 기사

뜨거운 도구

메모장++7.3.1
사용하기 쉬운 무료 코드 편집기

SublimeText3 중국어 버전
중국어 버전, 사용하기 매우 쉽습니다.

스튜디오 13.0.1 보내기
강력한 PHP 통합 개발 환경

드림위버 CS6
시각적 웹 개발 도구

SublimeText3 Mac 버전
신 수준의 코드 편집 소프트웨어(SublimeText3)

뜨거운 주제











HTML의 테이블 테두리 안내. 여기에서는 HTML의 테이블 테두리 예제를 사용하여 테이블 테두리를 정의하는 여러 가지 방법을 논의합니다.

HTML 여백-왼쪽 안내. 여기에서는 HTML margin-left에 대한 간략한 개요와 코드 구현과 함께 예제를 논의합니다.

HTML의 Nested Table에 대한 안내입니다. 여기에서는 각 예와 함께 테이블 내에 테이블을 만드는 방법을 설명합니다.

HTML 테이블 레이아웃 안내. 여기에서는 HTML 테이블 레이아웃의 값에 대해 예제 및 출력 n 세부 사항과 함께 논의합니다.

HTML 입력 자리 표시자 안내. 여기서는 코드 및 출력과 함께 HTML 입력 자리 표시자의 예를 논의합니다.

HTML 순서 목록에 대한 안내입니다. 여기서는 HTML Ordered 목록 및 유형에 대한 소개와 각각의 예에 대해서도 설명합니다.

HTML에서 텍스트 이동 안내. 여기서는 Marquee 태그가 구문과 함께 작동하는 방식과 구현할 예제에 대해 소개합니다.

HTML onclick 버튼에 대한 안내입니다. 여기에서는 각각의 소개, 작업, 예제 및 다양한 이벤트의 onclick 이벤트에 대해 설명합니다.
