웹사이트 관련 팁들을 모아놓은 곳입니다. 좋은팁 공유 합시다.
  • 웹미니 한줄 전광판 영역 입니다.
글 수 186

16

조회 수 : 3001 신고 : 0

profile
작성자 : title: [ani]깜빡이는 표정빽짱구
포인트 : 56933 | 레벨 : 25

미리보기 <==클릭

<head></head>사이에 아래소스 삽입

<!--달력스크립트 소스 시작-->
<script language="JavaScript">
<!--
var ns6=document.getElementById&&!document.all
var ie4=document.all

var Selected_Month;
var Selected_Year;
var Current_Date = new Date();
var Current_Month = Current_Date.getMonth();

var Days_in_Month = new Array(31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31);
var Month_Label = new Array('1월', '2월', '3월', '4얼', '5월', '6월', '7월', '8월', '9월', '10월', '11월', '12월');

var Current_Year = Current_Date.getYear();
if (Current_Year < 1000)
Current_Year+=1900


var Today = Current_Date.getDate();

function Header(Year, Month) {

if (Month == 1) {
Days_in_Month[1] = ((Year % 400 == 0) || ((Year % 4 == 0) && (Year % 100 !=0))) ? 29 : 28;
}
var Header_String = Month_Label[Month] + ' ' + Year;
return Header_String;
}

function Make_Calendar(Year, Month) {
var First_Date = new Date(Year, Month, 1);
var Heading = Header(Year, Month);
var First_Day = First_Date.getDay() + 1;
if (((Days_in_Month[Month] == 31) && (First_Day >= 6)) ||
((Days_in_Month[Month] == 30) && (First_Day == 7))) {
var Rows = 6;
}
else if ((Days_in_Month[Month] == 28) && (First_Day == 1)) {
var Rows = 4;
}
else {
var Rows = 5;
}

var HTML_String = '<table><tr><td valign="top"><table BORDER=4 CELLSPACING=1 cellpadding=2 FRAME="box" BGCOLOR="C0C0C0" BORDERCOLORLIGHT="808080">';

HTML_String += '<tr><th colspan=7 BGCOLOR="FFFFFF" BORDERCOLOR="000000">' + Heading + '</font></th></tr>';

HTML_String += '<tr><th ALIGN="CENTER" BGCOLOR="FFFFFF" BORDERCOLOR="000000">Sun</th><th ALIGN="CENTER" BGCOLOR="FFFFFF" BORDERCOLOR="000000">Mon</th><th ALIGN="CENTER" BGCOLOR="FFFFFF" BORDERCOLOR="000000">Tue</th><th ALIGN="CENTER" BGCOLOR="FFFFFF" BORDERCOLOR="000000">Wed</th>';

HTML_String += '<th ALIGN="CENTER" BGCOLOR="FFFFFF" BORDERCOLOR="000000">Thu</th><th ALIGN="CENTER" BGCOLOR="FFFFFF" BORDERCOLOR="000000">Fri</th><th ALIGN="CENTER" BGCOLOR="FFFFFF" BORDERCOLOR="000000">Sat</th></tr>';

var Day_Counter = 1;
var Loop_Counter = 1;
for (var j = 1; j <= Rows; j++) {
HTML_String += '<tr ALIGN="left" VALIGN="top">';
for (var i = 1; i < 8; i++) {
if ((Loop_Counter >= First_Day) && (Day_Counter <= Days_in_Month[Month])) {
if ((Day_Counter == Today) && (Year == Current_Year) && (Month == Current_Month)) {
HTML_String += '<td BGCOLOR="FFFFFF" BORDERCOLOR="000000"><strong><font color="red">' + Day_Counter + '</font></strong></td>';
}
else {
HTML_String += '<td BGCOLOR="FFFFFF" BORDERCOLOR="000000">' + Day_Counter + '</td>';
}
Day_Counter++;
}
else {
HTML_String += '<td BORDERCOLOR="C0C0C0"> </td>';
}
Loop_Counter++;
}
HTML_String += '</tr>';
}
HTML_String += '</table></td></tr></table>';
cross_el=ns6? document.getElementById("Calendar") : document.all.Calendar
cross_el.innerHTML = HTML_String;
}


function Check_Nums() {
if ((event.keyCode < 48) || (event.keyCode > 57)) {
return false;
}
}

function On_Year() {
var Year = document.when.year.value;
if (Year.length == 4) {
Selected_Month = document.when.month.selectedIndex;
Selected_Year = Year;
Make_Calendar(Selected_Year, Selected_Month);
}
}

function On_Month() {
var Year = document.when.year.value;
if (Year.length == 4) {
Selected_Month = document.when.month.selectedIndex;
Selected_Year = Year;
Make_Calendar(Selected_Year, Selected_Month);
}
else {
alert('Please enter a valid year.');
document.when.year.focus();
}
}


function Defaults() {
if (!ie4&&!ns6)
return
var Mid_Screen = Math.round(document.body.clientWidth / 2);
document.when.month.selectedIndex = Current_Month;
document.when.year.value = Current_Year;
Selected_Month = Current_Month;
Selected_Year = Current_Year;
Make_Calendar(Current_Year, Current_Month);
}


function Skip(Direction) {
if (Direction == '+') {
if (Selected_Month == 11) {
Selected_Month = 0;
Selected_Year++;
}
else {
Selected_Month++;
}
}
else {
if (Selected_Month == 0) {
Selected_Month = 11;
Selected_Year--;
}
else {
Selected_Month--;
}
}
Make_Calendar(Selected_Year, Selected_Month);
document.when.month.selectedIndex = Selected_Month;
document.when.year.value = Selected_Year;
}
//-->
</script>

 

위에 소스를 삽입했으면 <body>를 아래소스로 교체

<body onLoad="Defaults()">

그다음 아래의 소스를 <body></body>태그 사이에 넣어주세요

<!--날짜 선택 레이어의 너비와 위치 설정-->
<div id=NavBar style="position:relative;width:286px;top:5px;" align="left">
<!--폼 환경 설정-->
<form name="when">
<!--테이블 디자인-->
<table>
<tr>
<td><input type="button" value="이전달" onClick="Skip('-')"></td>
<td> </td>
<td><select name="month" onChange="On_Month()">

<script language="JavaScript1.2">
if (ie4||ns6){
for (j=0;j<Month_Label.length;j++) {
document.writeln('<option value=' + j + '>' + Month_Label[j]);
}
}
</script>

</select>
</td>
<td><input type="text" name="year" size=4 maxlength=4 onKeyPress="return Check_Nums()" onKeyUp="On_Year()"></td>
<td> </td>
<td><input type="button" value="다음달" onClick="Skip('+')"></td>
</tr>
</table>
<!--테이블 디자인 끝-->
</form>
<!--폼 환경 설정 끝-->
</div>
<!--달력 레이어의 너비와 위치 설정-->
<div id=Calendar style="position:relative;width:238px;top:-2px;" align="left"></div>

 

profile 글쓴이 빽짱구

단점이 없는 사람은 장점도 거의 없다 - 에이브러햄 링컨

엮인글 :
https://web.webmini.net/webtip/13987/33b/trackback
소중한 댓글 부탁드립니다.
추천수 10단위당 메달이 1개씩 노출되고, 추천수에 따라 배경색이 변하며, 일정수의 추천수를 받을시 BEST 아이콘이 붙게됩니다.
추천수에 따른 배경색 보기 본문으로 바로가기
  • 추천수 50개이상
  • 추천수 30개이상
  • 추천수 20개이상
  • 추천수 10개이상
  • 추천수 3개이상
닫기

첫번째 댓글을 남겨주세요!

List of Articles
번호 제목 글쓴이 날짜 추천 수 조회 수sort
86 제홈배너처럼 스크립트 프롬프트 띄우기 title: [ani]깜빡이는 표정빽짱구 2004-07-16 19 3218
85 금주가 이번해에 몇번째 주인지 알려주기 title: [ani]깜빡이는 표정빽짱구 2004-04-22 14 3214
84 best of best 제홈에 사용중인 스크롤바 색상 [1] title: [ani]깜빡이는 표정빽짱구 2004-10-13 34 3195
83 웹폰트 사용시 깨지는 한자 변환소스 title: [ani]깜빡이는 표정빽짱구 2004-03-07 10 3192
82 한영전환 변환키 [1] title: [ani]깜빡이는 표정빽짱구 2004-04-05 15 3170
81 링크 점선 테투리 없애기!! [3] 톡톡 2004-03-24 17 3155
80 홈페이지 풀스크린 [1] title: [ani]깜빡이는 표정빽짱구 2004-05-04 12 3134
79 년도,월,일,시간 표시하기 title: [ani]깜빡이는 표정빽짱구 2004-04-22 12 3115
78 best of best 글쓰기창 마우스오버시 늘었다 원래대로... title: [ani]깜빡이는 표정빽짱구 2004-02-29 23 3071
77 best of best HTML 테그표입니다. [2] title: [ani]깜빡이는 표정빽짱구 2004-02-17 38 3068
76 php 오류문구정리 [1] title: [ani]깜빡이는 표정빽짱구 2004-07-09 10 3051
75 투명하게 보이기 위한 레이어에 적용 [2] title: [ani]보라색 나비바비인형 2004-06-23 15 3028
74 best of best 아이프레임 [2] title: [ani]깜빡이는 표정빽짱구 2004-02-07 24 3009
73 이전, 다음 버튼이 있는 달력 title: [ani]깜빡이는 표정빽짱구 2004-04-22 16 3001
72 메일링 코딩 스타일 title: [ani]깜빡이는 표정빽짱구 2013-09-29 1 2979
71 best of best 이미지 & 파일 무단링크 막기 [1] title: [ani]깜빡이는 표정빽짱구 2004-02-22 28 2971
70 best of best 무료 도매인 포워딩 사이트 (100개) [1] title: [ani]깜빡이는 표정빽짱구 2004-02-19 27 2948
69 best of best 이미지 못가져가게 막기 [2] title: [ani]깜빡이는 표정빽짱구 2004-08-19 31 2928
68 로딩속도 빠르게 하기 title: [ani]깜빡이는 표정빽짱구 2004-04-20 14 2920
67 홈페이지나 까페에 뉴스소식 달기 아이프레임 이용. [2] title: [ani]깜빡이는 표정빽짱구 2004-02-17 18 2913