움직임이 자연스러운 자바시계
bbking
·
20년 전
·
조회 2341
2341
<html>
<head>
<title>art center nabi : Exhibitions : Online Exhibition </title>
<!--- Javascript clock ---->
<SCRIPT LANGUAGE="JavaScript">
<!-- Begin
dCol='000000';//dot colour.
fCol = 'ffffff'; //face colour.
sCol = 'ff0000'; //seconds colour.
mCol = '000000'; //minutes colour.
hCol = '000000'; //hours colour.
ClockHeight=30;
ClockWidth=30;
ClockFromMouseY=80;
ClockFromMouseX=5;
//Alter nothing below! Alignments will be lost!
ns=(document.layers);
ie=(document.all);
h=3;
m=4;
s=5;
face='1 2 3 4 5 6 7 8 9 10 11 12';
face=face.split(' ');
n=face.length;
speed=0.6;
ymouse=0;
xmouse=0;
scrll=0;
p="<font face=Arial size=1 color="+fCol+">";
e=360/n;
HandHeight=ClockHeight/4;
HandWidth=ClockWidth/4;
HandY=0;
HandX=0;
scrll=0;
y=new Array();x=new Array();Y=new Array();X=new Array();
for (i=0; i < 37; i++){y[i]=0;x[i]=0;Y[i]=0;X[i]=0}
Dy=new Array();Dx=new Array();DY=new Array();DX=new Array();
for (i=0; i < n; i++){Dy[i]=0;Dx[i]=0;DY[i]=0;DX[i]=0}
if (ns){
for (i=0; i < n; i++)
document.write('<layer name="nsN'+i+'" top=0 left=0 height=15 width=15><center>'+p+face[i]+'</font></center></layer>');
for (i=0; i < n; i++)
document.write('<layer name="nsD'+i+'" top=0 left=0 bgcolor='+dCol+' clip="0,0,2,2"></layer>');
for (i=0; i < h; i++)
document.write('<layer name=nsH'+i+' top=0 left=0 bgcolor='+hCol+' clip="0,0,2,2"></layer>');
for (i=0; i < m; i++)
document.write('<layer name=nsM'+i+' top=0 left=0 bgcolor='+mCol+' clip="0,0,2,2"></layer>');
for (i=0; i < s; i++)
document.write('<layer name=nsS'+i+' top=0 left=0 bgcolor='+sCol+' clip="0,0,2,2"></layer>');
}
if (ie){
document.write('<div id="On" style="position:absolute;top:0px;left:0px"><div style="position:relative">');
for (i=0; i < n; i++)
document.write('<div id="ieN" style="position:absolute;width:15px;height:15px;text-align:center">'+p+face[i]+'</font></div>');
document.write('</div></div>');
document.write('<div id="Od" style="position:absolute;top:0px;left:0px"><div style="position:relative">');
for (i=0; i < n; i++)
document.write('<div id="ieD" style="position:absolute;height:2px;width:2px;font-size:2px;background:'+dCol+'"></div>');
document.write('</div></div>');
document.write('<div id="Oh" style="position:absolute;top:0px;left:0px"><div style="position:relative">');
for (i=0; i < h; i++)
document.write('<div id="ieH" style="position:absolute;width:2px;height:2px;font-size:2px;background:'+hCol+'"></div>');
document.write('</div></div>');
document.write('<div id="Om" style="position:absolute;top:0px;left:0px"><div style="position:relative">');
for (i=0; i < m; i++)
document.write('<div id="ieM" style="position:absolute;width:2px;height:2px;font-size:2px;background:'+mCol+'"></div>');
document.write('</div></div>')
document.write('<div id="Os" style="position:absolute;top:0px;left:0px"><div style="position:relative">');
for (i=0; i < s; i++)
document.write('<div id="ieS" style="position:absolute;width:2px;height:2px;font-size:2px;background:'+sCol+'"></div>');
document.write('</div></div>')
}
(ns)?window.captureEvents(Event.MOUSEMOVE):0;
function Mouse(evnt){
ymouse = (ns)?evnt.pageY+ClockFromMouseY-(window.pageYOffset):event.y+ClockFromMouseY;
xmouse = (ns)?evnt.pageX+ClockFromMouseX:event.x+ClockFromMouseX;
}
(ns)?window.onMouseMove=Mouse:document.onmousemove=Mouse;
function ClockAndAssign(){
time = new Date ();
secs = time.getSeconds();
sec = -1.57 + Math.PI * secs/30;
mins = time.getMinutes();
min = -1.57 + Math.PI * mins/30;
hr = time.getHours();
hrs = -1.575 + Math.PI * hr/6+Math.PI*parseInt(time.getMinutes())/360;
if (ie){
On.style.top=window.document.body.scrollTop;
Od.style.top=window.document.body.scrollTop;
Oh.style.top=window.document.body.scrollTop;
Om.style.top=window.document.body.scrollTop;
Os.style.top=window.document.body.scrollTop;
}
for (i=0; i < s; i++){
var sd=(ns)?document.layers['nsS'+i]:ieS[i].style;
sd.top=y[8+i]+HandY+(i*HandHeight)*Math.sin(sec)+scrll;
sd.left=x[8+i]+HandX+(i*HandWidth)*Math.cos(sec);
}
for (i=0; i < m; i++){
var md=(ns)?document.layers['nsM'+i]:ieM[i].style;
md.top=y[4+i]+HandY+(i*HandHeight)*Math.sin(min)+scrll;
md.left=x[4+i]+HandX+(i*HandWidth)*Math.cos(min);
}
for (i=0; i < h; i++){
var hd=(ns)?document.layers['nsH'+i]:ieH[i].style;
hd.top=y[1+i]+HandY+(i*HandHeight)*Math.sin(hrs)+scrll;
hd.left=x[1+i]+HandX+(i*HandWidth)*Math.cos(hrs);
}
for (i=0; i < n; i++){
var D=(ns)?document.layers['nsD'+i]:ieD[i].style;
D.top=y[13+i] + ClockHeight*Math.sin(-1.0471 + i*e*Math.PI/180)+scrll;
D.left=x[13+i] + ClockWidth*Math.cos(-1.0471 + i*e*Math.PI/180);
}
for (i=0; i < n; i++){
var N=(ns)?document.layers['nsN'+i]:ieN[i].style;
N.top=y[25+i]-6 + ClockHeight*1.4*Math.sin(-1.0471 + i*e*Math.PI/180)+scrll;
N.left=x[25+i]-6 + ClockWidth*1.4*Math.cos(-1.0471 + i*e*Math.PI/180);
}
}
function Delay(){
scrll=(ns)?window.pageYOffset:0;
y[0]=Math.round(Y[0]+=((ymouse)-Y[0])*speed);
x[0]=Math.round(X[0]+=((xmouse)-X[0])*speed);
for (i=1; i < 37; i++){
y[i]=Math.round(Y[i]+=(y[i-1]-Y[i])*speed);
x[i]=Math.round(X[i]+=(x[i-1]-X[i])*speed);
}
ClockAndAssign();
setTimeout('Delay()',20);
}
if (ns||ie)window.onload=Delay;
// End -->
</script>
<!--- Javascript End Here ---->
</head>
<body leftmargin=0 topmargin=0 marginwidth="0" marginheight="0" text="#455B71" link="#455B71" vlink="#455B71" bgcolor="#999999">
<p align="left"> </p>
</body>
</html><div class='small'>[이 게시물은 관리자님에 의해 2011-10-31 16:57:14 JavaScript에서 이동 됨]</div>
<head>
<title>art center nabi : Exhibitions : Online Exhibition </title>
<!--- Javascript clock ---->
<SCRIPT LANGUAGE="JavaScript">
<!-- Begin
dCol='000000';//dot colour.
fCol = 'ffffff'; //face colour.
sCol = 'ff0000'; //seconds colour.
mCol = '000000'; //minutes colour.
hCol = '000000'; //hours colour.
ClockHeight=30;
ClockWidth=30;
ClockFromMouseY=80;
ClockFromMouseX=5;
//Alter nothing below! Alignments will be lost!
ns=(document.layers);
ie=(document.all);
h=3;
m=4;
s=5;
face='1 2 3 4 5 6 7 8 9 10 11 12';
face=face.split(' ');
n=face.length;
speed=0.6;
ymouse=0;
xmouse=0;
scrll=0;
p="<font face=Arial size=1 color="+fCol+">";
e=360/n;
HandHeight=ClockHeight/4;
HandWidth=ClockWidth/4;
HandY=0;
HandX=0;
scrll=0;
y=new Array();x=new Array();Y=new Array();X=new Array();
for (i=0; i < 37; i++){y[i]=0;x[i]=0;Y[i]=0;X[i]=0}
Dy=new Array();Dx=new Array();DY=new Array();DX=new Array();
for (i=0; i < n; i++){Dy[i]=0;Dx[i]=0;DY[i]=0;DX[i]=0}
if (ns){
for (i=0; i < n; i++)
document.write('<layer name="nsN'+i+'" top=0 left=0 height=15 width=15><center>'+p+face[i]+'</font></center></layer>');
for (i=0; i < n; i++)
document.write('<layer name="nsD'+i+'" top=0 left=0 bgcolor='+dCol+' clip="0,0,2,2"></layer>');
for (i=0; i < h; i++)
document.write('<layer name=nsH'+i+' top=0 left=0 bgcolor='+hCol+' clip="0,0,2,2"></layer>');
for (i=0; i < m; i++)
document.write('<layer name=nsM'+i+' top=0 left=0 bgcolor='+mCol+' clip="0,0,2,2"></layer>');
for (i=0; i < s; i++)
document.write('<layer name=nsS'+i+' top=0 left=0 bgcolor='+sCol+' clip="0,0,2,2"></layer>');
}
if (ie){
document.write('<div id="On" style="position:absolute;top:0px;left:0px"><div style="position:relative">');
for (i=0; i < n; i++)
document.write('<div id="ieN" style="position:absolute;width:15px;height:15px;text-align:center">'+p+face[i]+'</font></div>');
document.write('</div></div>');
document.write('<div id="Od" style="position:absolute;top:0px;left:0px"><div style="position:relative">');
for (i=0; i < n; i++)
document.write('<div id="ieD" style="position:absolute;height:2px;width:2px;font-size:2px;background:'+dCol+'"></div>');
document.write('</div></div>');
document.write('<div id="Oh" style="position:absolute;top:0px;left:0px"><div style="position:relative">');
for (i=0; i < h; i++)
document.write('<div id="ieH" style="position:absolute;width:2px;height:2px;font-size:2px;background:'+hCol+'"></div>');
document.write('</div></div>');
document.write('<div id="Om" style="position:absolute;top:0px;left:0px"><div style="position:relative">');
for (i=0; i < m; i++)
document.write('<div id="ieM" style="position:absolute;width:2px;height:2px;font-size:2px;background:'+mCol+'"></div>');
document.write('</div></div>')
document.write('<div id="Os" style="position:absolute;top:0px;left:0px"><div style="position:relative">');
for (i=0; i < s; i++)
document.write('<div id="ieS" style="position:absolute;width:2px;height:2px;font-size:2px;background:'+sCol+'"></div>');
document.write('</div></div>')
}
(ns)?window.captureEvents(Event.MOUSEMOVE):0;
function Mouse(evnt){
ymouse = (ns)?evnt.pageY+ClockFromMouseY-(window.pageYOffset):event.y+ClockFromMouseY;
xmouse = (ns)?evnt.pageX+ClockFromMouseX:event.x+ClockFromMouseX;
}
(ns)?window.onMouseMove=Mouse:document.onmousemove=Mouse;
function ClockAndAssign(){
time = new Date ();
secs = time.getSeconds();
sec = -1.57 + Math.PI * secs/30;
mins = time.getMinutes();
min = -1.57 + Math.PI * mins/30;
hr = time.getHours();
hrs = -1.575 + Math.PI * hr/6+Math.PI*parseInt(time.getMinutes())/360;
if (ie){
On.style.top=window.document.body.scrollTop;
Od.style.top=window.document.body.scrollTop;
Oh.style.top=window.document.body.scrollTop;
Om.style.top=window.document.body.scrollTop;
Os.style.top=window.document.body.scrollTop;
}
for (i=0; i < s; i++){
var sd=(ns)?document.layers['nsS'+i]:ieS[i].style;
sd.top=y[8+i]+HandY+(i*HandHeight)*Math.sin(sec)+scrll;
sd.left=x[8+i]+HandX+(i*HandWidth)*Math.cos(sec);
}
for (i=0; i < m; i++){
var md=(ns)?document.layers['nsM'+i]:ieM[i].style;
md.top=y[4+i]+HandY+(i*HandHeight)*Math.sin(min)+scrll;
md.left=x[4+i]+HandX+(i*HandWidth)*Math.cos(min);
}
for (i=0; i < h; i++){
var hd=(ns)?document.layers['nsH'+i]:ieH[i].style;
hd.top=y[1+i]+HandY+(i*HandHeight)*Math.sin(hrs)+scrll;
hd.left=x[1+i]+HandX+(i*HandWidth)*Math.cos(hrs);
}
for (i=0; i < n; i++){
var D=(ns)?document.layers['nsD'+i]:ieD[i].style;
D.top=y[13+i] + ClockHeight*Math.sin(-1.0471 + i*e*Math.PI/180)+scrll;
D.left=x[13+i] + ClockWidth*Math.cos(-1.0471 + i*e*Math.PI/180);
}
for (i=0; i < n; i++){
var N=(ns)?document.layers['nsN'+i]:ieN[i].style;
N.top=y[25+i]-6 + ClockHeight*1.4*Math.sin(-1.0471 + i*e*Math.PI/180)+scrll;
N.left=x[25+i]-6 + ClockWidth*1.4*Math.cos(-1.0471 + i*e*Math.PI/180);
}
}
function Delay(){
scrll=(ns)?window.pageYOffset:0;
y[0]=Math.round(Y[0]+=((ymouse)-Y[0])*speed);
x[0]=Math.round(X[0]+=((xmouse)-X[0])*speed);
for (i=1; i < 37; i++){
y[i]=Math.round(Y[i]+=(y[i-1]-Y[i])*speed);
x[i]=Math.round(X[i]+=(x[i-1]-X[i])*speed);
}
ClockAndAssign();
setTimeout('Delay()',20);
}
if (ns||ie)window.onload=Delay;
// End -->
</script>
<!--- Javascript End Here ---->
</head>
<body leftmargin=0 topmargin=0 marginwidth="0" marginheight="0" text="#455B71" link="#455B71" vlink="#455B71" bgcolor="#999999">
<p align="left"> </p>
</body>
</html><div class='small'>[이 게시물은 관리자님에 의해 2011-10-31 16:57:14 JavaScript에서 이동 됨]</div>
게시글 목록
| 번호 | 제목 |
|---|---|
| 28772 |
HTML
오늘 날짜와 요일 넣기
1
|
| 10555 | |
| 10554 |
JavaScript
홈에 머문시간을 제목표시줄과 상태바에 실시간으로 알려줍니다
|
| 10553 | |
| 28770 |
HTML
창의 사이즈 변경 금지 시키기
1
|
| 28769 |
HTML
손님의 방문 횟수를 알려 줍니다
|
| 10552 | |
| 10551 | |
| 28768 |
HTML
자바스크립트 버튼에 링크 걸기
|
| 10550 | |
| 10549 |
JavaScript
들어올때나 나갈때나 인사는 착실히 해야죠..ㅋㅋㅋㅋ
|
| 10548 | |
| 10547 | |
| 28767 |
HTML
이름을 물어보고 인사하는 스크립트
|
| 10546 | |
| 10545 |
JavaScript
창을 열면 인사하는 간단한 스크립트
|
| 10544 | |
| 28766 | |
| 10541 | |
| 10540 | |
| 10538 | |
| 10537 |
기타
순발력테스트
|
| 10535 |
Flash
Ajax강의
1
|
| 10534 |
JavaScript
named -- dns서버
|
| 10533 |
JavaScript
문서내 이미지갯수 출력
|
| 10532 | |
| 28760 | |
| 10531 | |
| 10530 |
JavaScript
리눅스 부팅후 자동 실행
|
| 28759 |
HTML
버튼에 스타일주기(익스)
|
| 10527 | |
| 10525 | |
| 10523 | |
| 10520 |
Flash
swish 서브메뉴 제작방법
2
|
| 28758 |
HTML
오른쪽마우스클릭시메뉴(익스전용)
|
| 28757 |
HTML
오른쪽마우스클릭시메뉴(익스전용)
|
| 10519 | |
| 10518 |
MySQL
mysql 자동 최적화 / 복구 스크립트
|
| 10517 |
JavaScript
내용 복사해서 붙어넣기 하면 출처까지가 따라서 나옴 (출처:네이버 소스)
|
| 10515 |
JavaScript
ncftp사용법
1
|
| 28756 |
HTML
영카트에서 카테고리 검색하기
|
| 10514 | |
| 10512 | |
| 10511 |
JavaScript
영어철저가 의심스러울때
|
| 10510 |
JavaScript
로그인할때 나오는 메시지 바꾸기
|
| 10509 | |
| 10508 | |
| 10507 | |
| 28755 |
HTML
자바스크립트로 url 획득
|
| 28751 | |
| 10506 |
JavaScript
파일을 엑셀 혹은 워드로 다운 받기
|
| 10505 | |
| 10504 |
JavaScript
테이블속성연습
|
| 10503 | |
| 10499 | |
| 10487 | |
| 28748 |
HTML
투명도조절
2
|
| 10486 | |
| 28747 | |
| 10484 |
JavaScript
날짜 계산하기
1
|
| 10483 |
기타
폼필드로 바탕색상조정
|
| 10482 | |
| 28746 |
HTML
버튼 하나로 링크두개를 열어보자
|
| 10480 |
JavaScript
접속시도를 여러번 하는 IP 자동 블락하기
1
|
| 10476 | |
| 10473 |
JavaScript
팝업창.. 지정한 시간대에 열기
2
|
| 10472 |
기타
한글 영문으로 변환
|
| 28745 |
HTML
[펌]다중 업로드
|
| 10460 | |
| 10456 | |
| 28739 | |
| 10455 | |
| 28738 | |
| 10451 | |
| 10448 | |
| 10446 |
JavaScript
font-weight 숫자로도 가능
1
|
| 10445 |
JavaScript
에디터 수정해서 쓰세요!
|
| 10444 |
기타
리사이즈 팝업
|
| 10442 | |
| 10439 |
JavaScript
배경음악 또는 배경이미지 등 브라우저를 열고 처음 접속시 한번만 실행
2
|
| 10408 |
Flash
무료 플래시 209개
30
|
| 10403 | |
| 10400 |
JavaScript
문서내에 글씨 찾기
2
|
| 10398 | |
| 10397 | |
| 10396 |
JavaScript
ssh dictionary attack 막기
|
| 10391 | |
| 10390 | |
| 28733 |
HTML
밑의 갤러리 압축 화일
4
|
| 10389 |
JavaScript
까만도둑님께서 플래쉬 갤러리가 필요하시다고 해서...
|
| 10383 | |
| 10378 |
Flash
플래시에서 tabIndex 적용하기
4
|
| 28732 | |
| 10342 |
Flash
간단하지만 유용한 배너관리 시스템
35
|
| 28731 | |
| 10335 |
Flash
플래시 자동 슬라이더
6
|
| 28730 |
HTML
cart클래스2
|
| 28729 |
HTML
cart클래스1
|
| 28727 |
HTML
비교 복사
1
|
| 10332 |
댓글 작성
댓글을 작성하시려면 로그인이 필요합니다.
로그인하기