精选JavaScript实例

整理文档很辛苦,赏杯茶钱您下走!

免费阅读已结束,点击下载阅读编辑剩下 ...

阅读已结束,您可以下载文档离线阅读编辑

资源描述

5221.效果展示2.脚本说明⑴把如下代码加入head区域中:SCRIPTlanguage=javascript!--pX=400;pY=200obs=newArray(13)functionob(){for(i=0;i13;i++){if(document.all)obs[i]=newArray(eval('ob'+i).style,-100,-100)elseobs[i]=newArray(eval('document.ob'+i),-100,-100)}}functioncl(a,b,c){if(document.all){if(a!=0)b+=-1eval('c'+a+'.style.pixelTop='+(pY+(c)))eval('c'+a+'.style.pixelLeft='+(pX+(b)))}else{if(a!=0)b+=10eval('document.c'+a+'.top='+(pY+(c)))eval('document.c'+a+'.left='+(pX+(b)))523}if(document.all)c0.style.pixelLeft=26}functionrunClock(){for(i=0;i13;i++){obs[i][0].left=obs[i][1]+pXobs[i][0].top=obs[i][2]+pY}}varlastsecfunctiontimer(){time=newDate()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++){obs[i][1]=Math.sin(sec)*(44-(i-1)*11)-16;if(document.layers)obs[i][1]+=10;obs[i][2]=-Math.cos(sec)*(44-(i-1)*11)-27;}for(i=6;i10;i++){obs[i][1]=Math.sin(min)*(40-(i-6)*10)-16;if(document.layers)obs[i][1]+=10;obs[i][2]=-Math.cos(min)*(40-(i-6)*10)-27;}for(i=10;i13;i++){obs[i][1]=Math.sin(hr)*(37-(i-10)*11)-16;if(document.layers)obs[i][1]+=10;obs[i][2]=-Math.cos(hr)*(37-(i-10)*11)-27;}}}functionsetNum(){cl(0,-67,-65);cl(1,10,-51);cl(2,28,-33);cl(3,35,-8);cl(4,28,17);524cl(5,10,35);cl(6,-15,42);cl(7,-40,35);cl(8,-58,17);cl(9,-65,-8);cl(10,-58,-33);cl(11,-40,-51);cl(12,-16,-56);}//--/SCRIPT⑵把body中加入如下代码:divid=c0style=position:absolute;right:6;top:6;z-index:2;/divdivid=c1style=position:absolute;left:20;top:-20;z-index:5;font-size:11px;b1/b/divdivid=c2style=position:absolute;left:20;top:-20;z-index:5;font-size:11px;b2/b/divdivid=c3style=position:absolute;left:20;top:-20;z-index:5;font-size:11px;b3/b/divdivid=c4style=position:absolute;left:20;top:-20;z-index:5;font-size:11px;b4/b/divdivid=c5style=position:absolute;left:20;top:-20;z-index:5;font-size:11px;b5/b/divdivid=c6style=position:absolute;left:20;top:-20;z-index:5;font-size:11px;b6/b/divdivid=c7style=position:absolute;left:20;top:-20;z-index:5;font-size:11px;b7/b/divdivid=c8style=position:absolute;left:20;top:-20;z-index:5;font-size:11px;b8/b/divdivid=c9style=position:absolute;left:20;top:-20;z-index:5;font-size:11px;b9/b/divdivid=c10style=position:absolute;left:20;top:-20;z-index:5;font-size:11px;b10/b/divdivid=c11style=position:absolute;left:20;top:-20;z-index:5;font-size:11px;b11/b/divdivid=c12style=position:absolute;left:20;top:-20;z-index:5;font-size:11px;b12/b/divdivid=ob0style=position:absolute;left:-20;top:-20;z-index:1/divdivid=ob1style=position:absolute;left:-20;top:-20;z-index:8fontsize=+3color=#0000FFb./b/font/divdivid=ob2style=position:absolute;left:-20;top:-20;z-index:8fontsize=+3color=#0000FFb./b/font/divdivid=ob3style=position:absolute;left:-20;top:-20;z-index:8fontsize=+3color=#0000FFb./b/font/divdivid=ob4style=position:absolute;left:-20;top:-20;z-index:8fontsize=+3color=#0000FFb./b/font/divdivid=ob5style=position:absolute;left:-20;top:-20;z-index:8fontsize=+3color=#0000FFb./b/font/divdivid=ob6style=position:absolute;left:-20;top:-20;z-index:7fontsize=+3color=#00FFFFb./b/font/div525divid=ob7style=position:absolute;left:-20;top:-20;z-index:7fontsize=+3color=#00FFFFb./b/font/divdivid=ob8style=position:absolute;left:-20;top:-20;z-index:7fontsize=+3color=#00FFFFb./b/font/divdivid=ob9style=position:absolute;left:-20;top:-20;z-index:7fontsize=+3color=#00FFFFb./b/font/divdivid=ob10style=position:absolute;left:-20;top:-20;z-index:6fontsize=+3color=#F30000b./b/font/divdivid=ob11style=position:absolute;left:-20;top:-20;z-index:6fontsize=+3color=#F30000b./b/font/divdivid=ob12style=position:absolute;left:-20;top:-20;z-index:6fontsize=+3color=#F30000b./b/font/div⑶把body中内容改为:bodybgcolor=#fef4d9onLoad=ob(),setNum(),setInterval('timer()',100);setInterval('runClock()',100)1.效果展示2.脚本说明:把如下代码加入body区域中LAYERNAME=a0LEFT=10TOP=10VISIBILITY=SHOWBGCOLOR=#ffffffCLIP=0,0,1,1/LAYERLAYERNAME=a1LEFT=10TOP=10VISIBILITY=SHOWBGCOLOR=#fff000CLIP=0,0,1,1/LAYERLAYERNAME=a2LEFT=10TOP=10VISIBILITY=SHOWBGCOLOR=#ffa000CLIP=0,0,1,1/LAYERLAYERNAME=a3LEFT=10TOP=10VISIBILITY=SHOWBGCOLOR=#ff00ffCLIP=0,0,1,1/LAYERLAYERNAME=a4LEFT=10TOP=10VISIBILITY=SHOWBGCOLOR=#00ff00CLIP=0,0,1,1/LAYER526LAYERNAME=a5LEFT=10TOP=10VISIBILITY=SHOWBGCOLOR=#FF00FFCLIP=0,0,1,1/LAYERLAYERNAME=a6LEFT=10TOP=10VISIBILITY=SHOWBGCOLOR=#FF0000CLIP=0,0,1,1/LAYERLAYERNAME=a7LEFT=10TOP=10VISIBILITY=SHOWBGCOLOR=#ffffffCLIP=0,0,2,2/LAYERLAYERNAME=a8LEFT=10TOP=10VISIBILITY=SHOWBGCOLOR=#fff000CLIP=0,0,2,2/LAYERLAYERNAME=a9LEFT=10TOP=10VISIBILITY=SHOWBGCOLOR=#ffa000CLIP=0,0,2,2/LAYERLAYERNAME=a10LEFT=10TOP=10VISIBILITY=SHOWBGCOLOR=#ff00ffCLIP=0,0,2,2/LAYERLAYERNAME=a11LEFT=10TOP=10VISIBILITY=SHOWBGCOLOR=#00ff00CLIP=0,0,2,2/LAYERLAY

1 / 26
下载文档,编辑使用

©2015-2020 m.777doc.com 三七文档.

备案号:鲁ICP备2024069028号-1 客服联系 QQ:2149211541

×
保存成功