<html>
<head>
<script language="JavaScript">
<!--
function init_clock()
{
var type, i, top, obj, clocks;
clocks = new Array();
for (i = 0, top = 0; i < init_clock.arguments.length; i += 2) {
obj = eval('document.'+init_clock.arguments[i]);
if (obj == null) continue;
if ((type = init_clock.arguments[i+1]) < 1 && 11 < type) continue;
clocks[top++] = obj;
clocks[top++] = type;
}
clocks.months = new Array('January', 'February', 'March', 'April', 'May', 'June', 'July',
'August', 'September', 'October', 'November', 'December');
clocks.days = new Array('Sunday', 'Monday', 'Tuesday', 'Wednesday',
'Thursday', 'Friday', 'Saturday');
clocks.k_days = new Array('일', '월', '화', '수', '목', '금', '토');
clocks.ampm_str = new Array('AM', 'PM');
clocks.k_ampm_str = new Array('오전', '오후');
if (top > 0) {
document.clocks = clocks;
clock();
}
}
function clock()
{
var i, type, clocks, next_call, str, hour, ampm, now, year2, year4;
clocks = document.clocks;
if (clocks == null) return;
next_call = false;
for (i = 0; i < clocks.length; i += 2) {
obj = clocks[i];
type = clocks[i+1];
now = new Date();
year2 = now.getYear();
year4 = year2;
if (year2 < 1000) year4 = 1900 + year2;
if (year2 >= 100) year2 = year4;
if (type == 1 || type == 2) {
obj.value = clocks.months[now.getMonth()] + ' ' + now.getDate() + ', ' + year4;
if (type == 2)
obj.value = clocks.days[now.getDay()] + ', ' + obj.value;
} else if (type == 3 || type == 4) {
obj.value = year2 + '/' + (now.getMonth()+1) + '/' + now.getDate();
} else if (type == 5 || type == 6) {
obj.value = now.getDate() + '/' + (now.getMonth()+1) + '/' + year2;
} else if (type == 8 || type == 9 || type == 10 || type == 11) {
obj.value = year4 + '년 ' + (now.getMonth()+1) + '월 ' + now.getDate() + '일';
if (type == 9)
obj.value += ' ' + clocks.k_days[now.getDay()] + '요일';
}
if (type == 4 || type == 6 || type == 7 || type == 10 || type == 11) {
hour = now.getHours();
ampm = 0;
if (hour >= 12) {
if (hour > 12) hour -= 12;
ampm = 1;
}
if (type == 10 || type == 11) {
str = clocks.k_ampm_str[ampm] +' '+ hour+'시 '+ now.getMinutes() +'분';
if (type == 11) str += ' ' + now.getSeconds() +'초';
} else {
str = hour +':'+ ((now.getMinutes() < 10) ? '0'+now.getMinutes():now.getMinutes()) +':'+ ((now.getSeconds() < 10) ? '0'+now.getSeconds():now.getSeconds()) +' '+ clocks.ampm_str[ampm];
}
if (type == 7) obj.value = str;
else obj.value += ' ' + str;
}
if (type == 4 || type == 6 || type == 7 || type == 10 || type == 11)
next_call = true;
}
if (next_call)
window.setTimeout("clock();", 1000);
}
// -->
</script>
</head>
<body OnLoad="init_clock('mclock.textclock1', 11);">
아래 init_clock('form1.textclock1', 11) 함수의 밑줄친 부분의 숫자를 바꾸면 다양한 효과를 줄 수 있습니다.
<!--
init_clock(mclock.textclock1', 11) 함수의 밑줄친 부분의 숫자를 바꾸면 다음과 같은 효과를 줄 수 있습니다.
1 : December 4, 2000
2 : Tuesday, December 4, 2000
3 : 2000/12/4
4 : 2000/12/4 1:49:46 PM
5 : 4/12/2000
6 : 4/12/2000 1:50:40 PM
7 : 1:50:58 PM
8 : 2000년 12월 4일
9 : 2000년 12월 4일 화요일
10 : 2000년 12월 4일 오후 1시 51분
11 : 2000년 12월 4일 오후 1시 52분 6초
-->
<form name="mclock">
<input type="text" name="textclock1" size="30" style="border-style:none;">
</form>
</body>
</html><div class='small'>[이 게시물은 관리자님에 의해 2011-10-31 16:57:14 JavaScript에서 이동 됨]</div>
<head>
<script language="JavaScript">
<!--
function init_clock()
{
var type, i, top, obj, clocks;
clocks = new Array();
for (i = 0, top = 0; i < init_clock.arguments.length; i += 2) {
obj = eval('document.'+init_clock.arguments[i]);
if (obj == null) continue;
if ((type = init_clock.arguments[i+1]) < 1 && 11 < type) continue;
clocks[top++] = obj;
clocks[top++] = type;
}
clocks.months = new Array('January', 'February', 'March', 'April', 'May', 'June', 'July',
'August', 'September', 'October', 'November', 'December');
clocks.days = new Array('Sunday', 'Monday', 'Tuesday', 'Wednesday',
'Thursday', 'Friday', 'Saturday');
clocks.k_days = new Array('일', '월', '화', '수', '목', '금', '토');
clocks.ampm_str = new Array('AM', 'PM');
clocks.k_ampm_str = new Array('오전', '오후');
if (top > 0) {
document.clocks = clocks;
clock();
}
}
function clock()
{
var i, type, clocks, next_call, str, hour, ampm, now, year2, year4;
clocks = document.clocks;
if (clocks == null) return;
next_call = false;
for (i = 0; i < clocks.length; i += 2) {
obj = clocks[i];
type = clocks[i+1];
now = new Date();
year2 = now.getYear();
year4 = year2;
if (year2 < 1000) year4 = 1900 + year2;
if (year2 >= 100) year2 = year4;
if (type == 1 || type == 2) {
obj.value = clocks.months[now.getMonth()] + ' ' + now.getDate() + ', ' + year4;
if (type == 2)
obj.value = clocks.days[now.getDay()] + ', ' + obj.value;
} else if (type == 3 || type == 4) {
obj.value = year2 + '/' + (now.getMonth()+1) + '/' + now.getDate();
} else if (type == 5 || type == 6) {
obj.value = now.getDate() + '/' + (now.getMonth()+1) + '/' + year2;
} else if (type == 8 || type == 9 || type == 10 || type == 11) {
obj.value = year4 + '년 ' + (now.getMonth()+1) + '월 ' + now.getDate() + '일';
if (type == 9)
obj.value += ' ' + clocks.k_days[now.getDay()] + '요일';
}
if (type == 4 || type == 6 || type == 7 || type == 10 || type == 11) {
hour = now.getHours();
ampm = 0;
if (hour >= 12) {
if (hour > 12) hour -= 12;
ampm = 1;
}
if (type == 10 || type == 11) {
str = clocks.k_ampm_str[ampm] +' '+ hour+'시 '+ now.getMinutes() +'분';
if (type == 11) str += ' ' + now.getSeconds() +'초';
} else {
str = hour +':'+ ((now.getMinutes() < 10) ? '0'+now.getMinutes():now.getMinutes()) +':'+ ((now.getSeconds() < 10) ? '0'+now.getSeconds():now.getSeconds()) +' '+ clocks.ampm_str[ampm];
}
if (type == 7) obj.value = str;
else obj.value += ' ' + str;
}
if (type == 4 || type == 6 || type == 7 || type == 10 || type == 11)
next_call = true;
}
if (next_call)
window.setTimeout("clock();", 1000);
}
// -->
</script>
</head>
<body OnLoad="init_clock('mclock.textclock1', 11);">
아래 init_clock('form1.textclock1', 11) 함수의 밑줄친 부분의 숫자를 바꾸면 다양한 효과를 줄 수 있습니다.
<!--
init_clock(mclock.textclock1', 11) 함수의 밑줄친 부분의 숫자를 바꾸면 다음과 같은 효과를 줄 수 있습니다.
1 : December 4, 2000
2 : Tuesday, December 4, 2000
3 : 2000/12/4
4 : 2000/12/4 1:49:46 PM
5 : 4/12/2000
6 : 4/12/2000 1:50:40 PM
7 : 1:50:58 PM
8 : 2000년 12월 4일
9 : 2000년 12월 4일 화요일
10 : 2000년 12월 4일 오후 1시 51분
11 : 2000년 12월 4일 오후 1시 52분 6초
-->
<form name="mclock">
<input type="text" name="textclock1" size="30" style="border-style:none;">
</form>
</body>
</html><div class='small'>[이 게시물은 관리자님에 의해 2011-10-31 16:57:14 JavaScript에서 이동 됨]</div>
댓글 3개
Photofly
19년 전
좋네요...감사합니다...^^
19년 전
감사~~
18년 전
감사합니다. 잘 쓰겠습니다.
게시판 목록
프로그램
| 번호 | 제목 | 글쓴이 | 날짜 | 조회 |
|---|---|---|---|---|
| 1130 | 18년 전 | 2466 | ||
| 1129 | 18년 전 | 2449 | ||
| 1128 | 18년 전 | 2320 | ||
| 1127 | 18년 전 | 2557 | ||
| 1126 |
|
18년 전 | 3852 | |
| 1125 | 18년 전 | 3659 | ||
| 1124 |
|
18년 전 | 2090 | |
| 1123 | 18년 전 | 2027 | ||
| 1122 | 18년 전 | 1569 | ||
| 1121 | 18년 전 | 3897 | ||
| 1120 | 18년 전 | 5893 | ||
| 1119 | 18년 전 | 6987 | ||
| 1118 | 18년 전 | 2469 | ||
| 1117 |
BEST79
|
18년 전 | 2721 | |
| 1116 | 18년 전 | 4183 | ||
| 1115 | 18년 전 | 2177 | ||
| 1114 |
|
18년 전 | 3632 | |
| 1113 | 18년 전 | 2875 | ||
| 1112 | 18년 전 | 2731 | ||
| 1111 | 18년 전 | 2198 | ||
| 1110 | 18년 전 | 2469 | ||
| 1109 | 18년 전 | 2606 | ||
| 1108 | 18년 전 | 3089 | ||
| 1107 | 18년 전 | 3733 | ||
| 1106 | 18년 전 | 3268 | ||
| 1105 | 18년 전 | 2782 | ||
| 1104 |
|
18년 전 | 2271 | |
| 1103 | 18년 전 | 2938 | ||
| 1102 | 18년 전 | 3025 | ||
| 1101 | 18년 전 | 2536 | ||
| 1100 | 18년 전 | 2297 | ||
| 1099 | 18년 전 | 3324 | ||
| 1098 | 18년 전 | 4844 | ||
| 1097 | 18년 전 | 5079 | ||
| 1096 | 18년 전 | 2299 | ||
| 1095 | 18년 전 | 2186 | ||
| 1094 | 18년 전 | 4999 | ||
| 1093 | 18년 전 | 8961 | ||
| 1092 | 18년 전 | 2040 | ||
| 1091 |
DeepnBlue
|
18년 전 | 4919 | |
| 1090 |
|
18년 전 | 4369 | |
| 1089 |
도날드주주
|
18년 전 | 2606 | |
| 1088 |
|
18년 전 | 4958 | |
| 1087 | 18년 전 | 2788 | ||
| 1086 | 18년 전 | 3672 | ||
| 1085 | 18년 전 | 2616 | ||
| 1084 | 18년 전 | 3432 | ||
| 1083 | 18년 전 | 1940 | ||
| 1082 | 18년 전 | 5373 | ||
| 1081 | 18년 전 | 1691 | ||
| 1080 | 18년 전 | 6050 | ||
| 1079 |
|
18년 전 | 2878 | |
| 1078 | 18년 전 | 6036 | ||
| 1077 |
|
18년 전 | 6838 | |
| 1076 | 18년 전 | 3725 | ||
| 1075 | 18년 전 | 2206 | ||
| 1074 |
hwatta
|
18년 전 | 2096 | |
| 1073 | 18년 전 | 6899 | ||
| 1072 | 18년 전 | 2397 | ||
| 1071 | 18년 전 | 3953 | ||
| 1070 |
|
18년 전 | 5343 | |
| 1069 | 18년 전 | 2691 | ||
| 1068 | 18년 전 | 1750 | ||
| 1067 | 18년 전 | 1581 | ||
| 1066 | 18년 전 | 1530 | ||
| 1065 | 18년 전 | 1808 | ||
| 1064 | 18년 전 | 1800 | ||
| 1063 | 18년 전 | 1781 | ||
| 1062 | 18년 전 | 1715 | ||
| 1061 | 18년 전 | 2508 | ||
| 1060 | 18년 전 | 2312 | ||
| 1059 | 18년 전 | 3465 | ||
| 1058 | 18년 전 | 2593 | ||
| 1057 | 18년 전 | 2574 | ||
| 1056 | 18년 전 | 3409 | ||
| 1055 | 18년 전 | 4624 | ||
| 1054 | 18년 전 | 2962 | ||
| 1053 | 18년 전 | 2807 | ||
| 1052 | 18년 전 | 3349 | ||
| 1051 | 18년 전 | 6278 | ||
| 1050 | 18년 전 | 2180 | ||
| 1049 | 18년 전 | 1990 | ||
| 1048 | 18년 전 | 1946 | ||
| 1047 | 18년 전 | 2008 | ||
| 1046 | 18년 전 | 3195 | ||
| 1045 | 18년 전 | 2263 | ||
| 1044 | 18년 전 | 1955 | ||
| 1043 | 18년 전 | 1619 | ||
| 1042 | 18년 전 | 2079 | ||
| 1041 | 18년 전 | 3366 | ||
| 1040 | 18년 전 | 3232 | ||
| 1039 | 18년 전 | 1919 | ||
| 1038 | 18년 전 | 1496 | ||
| 1037 | 18년 전 | 3187 | ||
| 1036 | 18년 전 | 2059 | ||
| 1035 | 18년 전 | 1613 | ||
| 1034 | 18년 전 | 2837 | ||
| 1033 | 18년 전 | 1971 | ||
| 1032 | 18년 전 | 1843 | ||
| 1031 | 18년 전 | 1815 |
댓글 작성
댓글을 작성하시려면 로그인이 필요합니다.
로그인하기