민미네 집
처음으로 갑니다.
메인페이지
민 미 소 개
민수일기장
미정일기장
추천사이트
태그자료실
태그연습장



  
  멋진 미니달력/폼을 마우스로 클릭하면 달력이 나타나..
  
    
  2008-06-18 18:52:21   1744 

<html>
<head>
<title>YouJung`sscript</title>
<meta http-equiv="Content-Type" content="text/html; charset=ks_c_5601-1987">
<meta http-equiv="Content-Language" content="ko">
<meta http-equiv="Expires" content="0">
<style>
<!--
#minical {background : buttonface; margin: 5; margin-top: 2;
border-top: 1 solid buttonhighlight;
border-left: 1 solid buttonhighlight;
border-right: 1 solid buttonshadow;
border-bottom: 1 solid buttonshadow;
width:155;display:none;position: absolute; z-index: 99}
-->
</style>
<script type="text/javascript">
var target;

function MiniCal(jucke) {
target=jucke
x = (document.layers) ? loc.pageX : event.clientX;
y = (document.layers) ? loc.pageY : event.clientY;
minical.style.pixelTop = y-0;
minical.style.pixelLeft = x-50;
minical.style.display = (minical.style.display == "block") ? "none" : "block";
Show_cal(0,0,0)
}
var stime
function doOver() {
var el = window.event.srcElement;
cal_Day = el.title;

if (cal_Day.length > 7) {
el.style.borderTopColor = el.style.borderLeftColor = "buttonhighlight";
el.style.borderRightColor = el.style.borderBottomColor = "buttonshadow";
}
window.clearTimeout(stime);
}
function doClick() {
cal_Day = window.event.srcElement.title;
window.event.srcElement.style.borderColor = "red";
if (cal_Day.length > 7) {
target.value=cal_Day
}
}
function doOut() {
var el = window.event.fromElement;
cal_Day = el.title;

if (cal_Day.length > 7) {
el.style.borderColor = "white";
}
stime=window.setTimeout("minical.style.display='none';", 200);
}

</script>

<script Language="Vbscript">
Function Show_cal(sYear,sMonth,sDay)
document.all.minical.innerHTML=""
datToday=date()

intThisYear = cint("0"&sYear) '년도넘겨받기
intThisMonth= cint("0"&sMonth) '월 넘겨받기
intThisDay = cint("0"&sDay)

if intThisYear =0 then intThisYear=Year(datToday) '만약 년도와 월값을 넘겨받지 않았다면 현재 년도를 년도 변수에
if intThisMonth =0 then intThisMonth=Month(datToday) ' 현재 월을 월 변수에
if intThisDay =0 then intThisDay=day(datToday) '오늘 날짜

if intThisMonth=1 then
intPrevYear=intThisYear-1
intPrevMonth=12
intNextYear=intThisYear
intNextMonth=2
elseif intThisMonth=12 then
intPrevYear=intThisYear
intPrevMonth=11
intNextYear=intThisYear + 1
intNextMonth=1
else
intPrevYear=intThisYear
intPrevMonth=intThisMonth -1
intNextYear=intThisYear
intNextMonth=intThisMonth+1
end if

NowThisYear=Year(datToDay) ' 현재연도값
NowThisMonth=Month(datToday) '현재 월값
NowThisDay=Day(datToday) '오늘 날짜 값

datFirstDay=DateSerial(intThisYear, intThisMonth, 1) '넘겨받은 날짜의 월초기값 파악
intFirstWeekday=Weekday(datFirstDay, vbSunday) '넘겨받은 날짜의 주초기값 파악
intSecondWeekday=intFirstWeekday
intThirdWeekday=intFirstWeekday

datThisDay=cdate(intThisYear&"-"&intThisMonth&"-"&intThisDay)
intThisWeekday=Weekday(datThisDay)

Select Case intThisWeekday
Case 1 varThisWeekday="일"
Case 2 varThisWeekday="월"
Case 3 varThisWeekday="화"
Case 4 varThisWeekday="수"
Case 5 varThisWeekday="목"
Case 6 varThisWeekday="금"
Case 7 varThisWeekday="토"
End Select

intPrintDay=1 '출력 초기일 값은 1부터
secondPrintDay=1
thirdPrintDay=1

Stop_Flag=0

if intThisMonth=4 or intThisMonth=6 or intThisMonth=9 or intThisMonth=11 then '월말 값 계산
intLastDay=30
elseif intThisMonth=2 and not (intThisYear mod 4) = 0 then
intLastDay=28
elseif intThisMonth=2 and (intThisYear mod 4) = 0 then
if (intThisYear mod 100) = 0 then
if (intThisYear mod 400) = 0 then
intLastDay=29
else
intLastDay=28
end if
else
intLastDay=29
end if
else
intLastDay=31
end if

if intPrevMonth=4 or intPrevMonth=6 or intPrevMonth=9 or intPrevMonth=11 then '월말 값 계산
intPrevLastDay=30
elseif intPrevMonth=2 and not (intPrevYear mod 4) = 0 then
intPrevLastDay=28
elseif intPrevMonth=2 and (intPrevYear mod 4) = 0 then
if (intPrevYear mod 100) = 0 then
if (intPrevYear mod 400) = 0 then
intPrevLastDay=29
else
intPrevLastDay=28
end if
else
intPrevLastDay=29
end if
else
intPrevLastDay=31
end if

Stop_Flag=0
Cal_HTML=Cal_HTML& "<table border=0 cellpadding=1 cellspacing=1 onmouseover='doOver()' onmouseout='doOut()' onclick='doClick()' style='font-size : 12;font-family:굴림;'>"
Cal_HTML=Cal_HTML& "<tr align=center>"
Cal_HTML=Cal_HTML& "<td align=left title='이전달' style='cursor:hand;' OnClick='vbscript:call Show_cal("&intPrevYear&","&intPrevMonth&",1)'><font color=navy size=2><<</font></td>"
Cal_HTML=Cal_HTML& "<td colspan=5><font color=red><b>"
Cal_HTML=Cal_HTML& intThisYear&"년 "&intThisMonth&"월"
Cal_HTML=Cal_HTML& "</font></b></td>"
Cal_HTML=Cal_HTML& "<td align=right title='다음달' style='cursor:hand;' OnClick='vbscript:call Show_cal("&intNextYear&","&intNextMonth&",1)'><font color=navy size=2>>></font></a></td>"
Cal_HTML=Cal_HTML& "</tr>"
Cal_HTML=Cal_HTML& "<tr align=center bgcolor=navy style='color:white; font-weight:bold'>"
Cal_HTML=Cal_HTML& "<td>일</td><td>월</td><td>화</td><td>수</td><td>목</td><td>금</td><td>토</td>"
Cal_HTML=Cal_HTML& "</tr>"

FOR intLoopWeek=1 to 6 '주단위 루프 시작, 최대 6주

Cal_HTML=Cal_HTML& "<tr align=right valign=top bgcolor=white >"
for intLoopDay=1 to 7 '요일단위 루프 시작, 일요일부터

if intThirdWeekDay > 1 then '첫주시작일이 1보다 크면
Cal_HTML=Cal_HTML& "<td> </td>"
intThirdWeekDay=intThirdWeekDay-1
else
if thirdPrintDay > intLastDay then '입력날짜가 월말보다 크다면
Cal_HTML=Cal_HTML& "<td> </td>"
else '입력날짜가 현재월에 해당되면
Cal_HTML=Cal_HTML& "<td title='"&intThisYear&"-"&intThisMonth&"-"&thirdPrintDay&"' style='cursor: hand;border: 1px solid white;width:18; height:18;"if intThisYear-NowThisYear=0 and intThisMonth-NowThisMonth=0 and thirdPrintDay-intThisDay=0 then '오늘 날짜이면은 글씨폰트를 다르게Cal_HTML=Cal_HTML& "background-color:cyan;"end ifif intLoopDay=1 then '일요일이면 빨간 색으로Cal_HTML=Cal_HTML& "color:red;"else ' 그외의 경우Cal_HTML=Cal_HTML& "color:black;"end ifCal_HTML=Cal_HTML& "'>"&thirdPrintDay
end if
thirdPrintDay=thirdPrintDay+1 '날짜값을 1 증가

if thirdPrintDay > intLastDay then Stop_Flag=1 '만약 날짜값이 월말값보다 크면 루프문 탈출

end if
Cal_HTML=Cal_HTML& "</td>"
next
Cal_HTML=Cal_HTML& "</tr>"
if Stop_Flag=1 then EXIT FOR
NEXT
Cal_HTML=Cal_HTML& "</table>"
Cal_HTML=Cal_HTML& ""
Cal_HTML=Cal_HTML& ""
document.all.minical.innerHTML=Cal_HTML
END Function
</script>

</head>
<body style="font:menu">
<div id=minical OnClick="this.style.display='none';" oncontextmenu='return false' ondragstart='return false' onselectstart='return false' style="background : buttonface; margin: 5; margin-top: 2;border-top: 1 solid buttonhighlight;border-left: 1 solid buttonhighlight;border-right: 1 solid buttonshadow;border-bottom: 1 solid buttonshadow;width:155;display:none;position: absolute; z-index: 99"></div>
<input type=text value="클릭하면 달력이 나와요!" size=22 OnClick="MiniCal(this);" readonly style="text-align:center; font:menu">




22   이미지에 섬광주기   2010/01/05 828
21   텍스트를 세로로   2010/01/05 847
20   테이블에도 그라데이션 효과를 줄 수 있다.   2010/01/05 884
19   alpha filte 의 사용법   2009/06/07 857
18   alpha filte 의 사용법   2009/06/07 954
17   메뉴   2009/04/28 889
16   자동줄바꿈 (valign=top)과 pre   2009/04/09 920
15   포토삽 강좌 / 67가지 [펌]   2008/06/28 843
14   테이블 만들기   2008/06/28 898
13   mp3파일변환/음질은 낮추고 확장자엔 영향안주는 프로그램   2008/06/19 928
12   예쁜 메뉴판   2008/06/18 890
11   책갈피가 있는 시   2008/06/18 888
10   META 태그의 속성   2008/06/18 1063
9   링크 밑줄 없애기   2008/06/18 898
8   글자가 가운데에서 튀어 나오는 소스   2008/06/18 896
  멋진 미니달력/폼을 마우스로 클릭하면 달력이 나타나..   2008/06/18 1744
6   특정일의 남은 날짜 나타내기 (기념일 카운트다운)   2008/06/18 1049
5   이미지 슬라이드 쑈 2   2008/06/18 915
4   이미지 슬라이드 쑈 1   2008/06/18 870
3   윈도우 XP 팁 모음   2008/06/18 802

1 [2]
 

Copyright 1999-2021 Zeroboard / skin by Mely

Copyright (c) 2002 MinMi. All rights Reserved.