js实现的跟随鼠标移动的时钟效果(中英文日期显示)
中文日期限制
";
props2="";
Split=360/n;
Dsplit=360/D.length;
HandHeight=ClockHeight/4.5
HandWidth=ClockWidth/4.5
HandY=-7;
HandX=-2.5;
scrll=0;
step=0.06;
currStep=0;
y=new Array();x=new Array();Y=new Array();X=new Array();
for (i=0; i '+props2+D[i]+'');
for (i=0; i '+props+Face[i]+'');
for (i=0; i '+S[i]+'');
for (i=0; i '+M[i]+'');
for (i=0; i '+H[i]+'');
}
if (ie){
document.write('
');
for (i=0; i '+props2+D[i]+'
');
document.write('
');
document.write('
');
for (i=0; i '+props+Face[i]+'
');
document.write('
');
document.write('
');
for (i=0; i '+H[i]+'
');
document.write('
');
document.write('
');
for (i=0; i '+M[i]+'
');
document.write('
')
document.write('
');
for (i=0; i '+S[i]+'
');
document.write('
')
}
(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){
Od.style.top=window.document.body.scrollTop;
Of.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
[Ctrl+A 全选 注:如需引入外部Js需刷新才能执行]
英文日期显示:
dCol='000099';//date colour.
fCol='668099';//face colour.
sCol='FF0000';//seconds colour.
mCol='000000';//minutes colour.
hCol='000000';//hours colour.
ClockHeight=40;
ClockWidth=40;
ClockFromMouseY=0;
ClockFromMouseX=100;
//Alter nothing below! Alignments will be lost!
d=new Array("SUNDAY","MONDAY","TUESDAY","WEDNESDAY","THURSDAY","FRIDAY","SATURDAY");
m=new Array("JANUARY","FEBRUARY","MARCH","APRIL","MAY","JUNE","JULY","AUGUST","SEPTEMBER","OCTOBER","NOVEMBER","DECEMBER");
date=new Date();
day=date.getDate();
year=date.getYear();
if (year ";
props2="";
Split=360/n;
Dsplit=360/D.length;
HandHeight=ClockHeight/4.5
HandWidth=ClockWidth/4.5
HandY=-7;
HandX=-2.5;
scrll=0;
step=0.06;
currStep=0;
y=new Array();x=new Array();Y=new Array();X=new Array();
for (i=0; i '+props2+D[i]+'');
for (i=0; i '+props+Face[i]+'');
for (i=0; i '+S[i]+'');
for (i=0; i '+M[i]+'');
for (i=0; i '+H[i]+'');
}
if (ie){
document.write('
');
for (i=0; i '+props2+D[i]+'
');
document.write('
');
document.write('
');
for (i=0; i '+props+Face[i]+'
');
document.write('
');
document.write('
');
for (i=0; i '+H[i]+'
');
document.write('
');
document.write('
');
for (i=0; i '+M[i]+'
');
document.write('
')
document.write('
');
for (i=0; i '+S[i]+'
');
document.write('
')
}
(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){
Od.style.top=window.document.body.scrollTop;
Of.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
[Ctrl+A 全选 注:如需引入外部Js需刷新才能执行]