JS時(shí)鐘匯總(1).doc_第1頁(yè)
JS時(shí)鐘匯總(1).doc_第2頁(yè)
JS時(shí)鐘匯總(1).doc_第3頁(yè)
JS時(shí)鐘匯總(1).doc_第4頁(yè)
JS時(shí)鐘匯總(1).doc_第5頁(yè)
已閱讀5頁(yè),還剩38頁(yè)未讀 繼續(xù)免費(fèi)閱讀

下載本文檔

版權(quán)說(shuō)明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請(qǐng)進(jìn)行舉報(bào)或認(rèn)領(lǐng)

文檔簡(jiǎn)介

JS時(shí)鐘匯總 (一)正常時(shí)間顯示!-function Year_Month()var now = new Date();var yy = now.getYear();var mm = now.getMonth();var mmm=new Array();mmm0=January;mmm1=February ;mmm2=March;mmm3=April;mmm4=May;mmm5=June;mmm6=July;mmm7=August;mmm8=September;mmm9=October;mmm10=November;mmm11=December;mm=mmmmm;return(mm ); function thisYear()var now = new Date();var yy = now.getYear();return(yy ); function Date_of_Today()var now = new Date();return(now.getDate() ); function CurentTime()var now = new Date();var hh = now.getHours();var mm = now.getMinutes();var ss = now.getTime() % 60000;ss = (ss - (ss % 1000) / 1000;var clock = hh+:;if (mm 10) clock += 0;clock += mm+:;if (ss 10) clock += 0;clock += ss;return(clock); function refreshCalendarClock()document.all.calendarClock1.innerHTML = Year_Month();document.all.calendarClock2.innerHTML = Date_of_Today();document.all.calendarClock3.innerHTML =thisYear();document.all.calendarClock4.innerHTML = CurentTime(); document.write( );document.write( ,);document.write( );document.write( );setInterval(refreshCalendarClock(),1000);/-固定位置的時(shí)鐘12)dn=PMhours=hours-12if(hours=0)hours=12if(minutes=9)minutes=0+minutesif(seconds=9)seconds=0+seconds/change font size here to your desiremyclock=現(xiàn)在時(shí)間:+hours+:+minutes+:+seconds+ +dn+;if(document.layers)document.layers.liveclock.document.write(myclock)document.layers.liveclock.document.close()else if(document.all)liveclock.innerHTML=myclocksetTimeout(show5(),1000)/-背景時(shí)鐘!-/function clockon() thistime= new Date()var hours=thistime.getHours()var minutes=thistime.getMinutes()var seconds=thistime.getSeconds()if (eval(hours) 10) hours=0+hoursif (eval(minutes) 10) minutes=0+minutesif (seconds 10) seconds=0+secondsthistime = hours+:+minutes+:+secondsif(document.all) bgclocknoshade.innerHTML=thistimebgclockshade.innerHTML=thistimeif(document.layers) document.bgclockshade.document.write(+thistime+)document.bgclocknoshade.document.write(+thistime+)document.close()var timer=setTimeout(clockon(),200)/-文本框里的時(shí)鐘簡(jiǎn)易時(shí)鐘 12) ? hours - 12 : hours)timeValue += (minutes 10) ? :0 : :) + minutestimeValue += (seconds = 12) ? P.M. : A.M.document.clock.face.value = timeValuetimerID = setTimeout(showtime(),1000)timerRunning = true/-按鈕時(shí)鐘!- Beginday = new Date();miVisit = day.getTime();function clock() today = new Date();hrNow = today.getHours();mnNow = today.getMinutes(); scNow = today.getSeconds();miNow = today.getTime();if (hrNow = 0) hour = 12;ap = A; else if(hrNow = 13) hour = (hrNow - 12);ap = P;if (hrNow = 13) hour = hrNow - 12;if (mnNow = 9) min = 0 + mnNow;else (min = mnNow)if (scNow = 9) secs = 0 + scNow; else secs = scNow;time = hour + : + min + : + secs + ap;document.form.button.value = time;setTimeout(clock(), 1000);function timeInfo() milliSince = miNow;milliNow = miNow - miVisit;secsVisit = Math.round(milliNow / 1000);minsVisit = (milliNow / 1000) / 60;alert(給你提個(gè)醒: + 你已經(jīng)在本頁(yè)面上停留了大約 + minsVisit + 分或+ secsVisit + 秒);document.write(+ );onError = null;clock();/ End -石英鐘pX=200;pY=100obs = new Array(13)function ob () for (i=0; i13; i+) if (document.all) obs=new Array (eval(ob+i).style,-100,-100)else obs = new Array (eval(document.ob+i),-100,-100)function cl(a,b,c)if (document.all) if (a!=0) b+=-1eval(c+a+.style.pixelTop=+(pY+(c)eval(c+a+.style.pixelLeft=+(pX+(b)elseif (a!=0) b+=10eval(document.c+a+.top=+(pY+(c)eval(document.c+a+.left=+(pX+(b)if (document.all) c0.style.pixelLeft=26function runClock() for (i=0; i13; i+) obs0.left=obs1+pXobs0.top=obs2+pYvar lastsecfunction timer() time = new Date ()sec = time.getSeconds()if (sec!=lastsec) lastsec = secsec=Math.PI*sec/30min=Math.PI*time.getMinutes()/30hr =Math.PI*(time.getHours()*60)+time.getMinutes()/360for (i=1;i6;i+) obs1 = Math.sin(sec) * (44 - (i-1)*11)-16;if (document.layers)obs1+=10;obs2 = -Math.cos(sec) * (44 - (i-1)*11)-27;for (i=6;i10;i+) obs1 = Math.sin(min) * (40 - (i-6)*10)-16;if (document.layers)obs1+=10;obs2 = -Math.cos(min) * (40 - (i-6)*10)-27;for (i=10;i 1 2 3 4 5 6 7 8 9 10 11 12 . . . . . . . . . . . .跟隨鼠標(biāo)的鐘dCol=cc0000;/date colour.fCol=0099ff;/face colour.sCol=ff0000;/seconds colour.mCol=0099ff;/minutes colour.hCol=0099ff;/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 2000) year=year+1900;TodaysDate= +ddate.getDay()+ +day+ +mdate.getMonth()+ +year;D=TodaysDate.split();H=.;H=H.split();M=.;M=M.split();S=.;S=S.split();Face=1 2 3 4 5 6 7 8 9 10 11 12;font=tahoma;size=1;speed=0.6;ns=(document.layers);ie=(document.all);Face=Face.split( );n=Face.length;a=size*10;ymouse=0;xmouse=0;scrll=0;props=;props2=;Split=360/n;Dsplit=360/D.length;HandHeight=ClockHeight/4.5HandWidth=ClockWidth/4.5HandY=-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 n; i+)y=0;x=0;Y=0;X=0Dy=new Array();Dx=new Array();DY=new Array();DX=new Array();for (i=0; i D.length; i+)Dy=0;Dx=0;DY=0;DX=0if (ns)for (i=0; i D.length; i+)document.write(+props2+D+);for (i=0; i n; i+)document.write(+props+Face+);for (i=0; i S.length; i+)document.write(+S+);for (i=0; i M.length; i+)document.write(+M+);for (i=0; i H.length; i+)document.write(+H+);if (ie)document.write();for (i=0; i D.length; i+)document.write(+props2+D+);document.write();document.write();for (i=0; i n; i+)document.write(+props+Face+);document.write();document.write();for (i=0; i H.length; i+)document.write(+H+);document.write();document.write();for (i=0; i M.length; i+)document.write(+M+);document.write()document.write();for (i=0; i S.length; i+)document.write(+S+);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 n; i+)var F=(ns)?document.layersnsFace+i:ieFace.style;F.top=y + ClockHeight*Math.sin(-1.0471 + i*Split*Math.PI/180)+scrll;F.left=x + ClockWidth*Math.cos(-1.0471 + i*Split*Math.PI/180);for (i=0; i H.length; i+)var HL=(ns)?document.layersnsHours+i:ieHours.style;HL.top=y+HandY+(i*HandHeight)*Math.sin(hrs)+scrll;HL.left=x+HandX+(i*HandWidth)*Math.cos(hrs);for (i=0; i M.length; i+)var ML=(ns)?document.layersnsMinutes+i:ieMinutes.style;ML.top=y+HandY+(i*HandHeight)*Math.sin(min)+scrll;ML.left=x+HandX+(i*HandWidth)*Math.cos(min);for (i=0; i S.length; i+)var SL=(ns)?document.layersnsSeconds+i:ieSeconds.style;SL.top=y+HandY+(i*HandHeight)*Math.sin(sec)+scrll;SL.left=x+HandX+(i*HandWidth)*Math.cos(sec);for (i=0; i D.length; i+)var DL=(ns)?document.layersnsDate+i:ieDate.style;DL.top=Dy + ClockHeight*1.5*Math.sin(currStep+i*Dsplit*Math.PI/180)+scrll;DL.left=Dx + ClockWidth*1.5*Math.cos(currStep+i*Dsplit*Math.PI/180);currStep-=step;function Delay()scrll=(ns)?window.pageYOffset:0;Dy0=Math.round(DY0+=(ymouse)-DY0)*speed);Dx0=Math.round(DX0+=(xmouse)-DX0)*speed);for (i=1; i D.length; i+)Dy=Math.round(DY+=(Dyi-1-DY)*speed);Dx=Math.round(DX+=(Dxi-1-DX)*speed);y0=Math.round(Y0+=(ymouse)-Y0)*speed);x0=Math.round(X0+=(xmouse)-X0)*speed);for (i=1; i n; i+)y=Math.round(Y+=(yi-1-Y)*speed);x=Math.round(X+=(xi-1-X)*speed);ClockAndAssign();setTimeout(Delay(),20);if (ns|ie)window.onload=Delay;標(biāo)題欄顯示動(dòng)態(tài)時(shí)間!- Beginvar clocktext;var pagetitle = document.title;function scroll() today = new Date();sec

溫馨提示

  • 1. 本站所有資源如無(wú)特殊說(shuō)明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請(qǐng)下載最新的WinRAR軟件解壓。
  • 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請(qǐng)聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
  • 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁(yè)內(nèi)容里面會(huì)有圖紙預(yù)覽,若沒(méi)有圖紙預(yù)覽就沒(méi)有圖紙。
  • 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
  • 5. 人人文庫(kù)網(wǎng)僅提供信息存儲(chǔ)空間,僅對(duì)用戶上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對(duì)用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對(duì)任何下載內(nèi)容負(fù)責(zé)。
  • 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請(qǐng)與我們聯(lián)系,我們立即糾正。
  • 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時(shí)也不承擔(dān)用戶因使用這些下載資源對(duì)自己和他人造成任何形式的傷害或損失。

評(píng)論

0/150

提交評(píng)論