附录BJavaScript特效制作与欣赏文字特效菜单特效鼠标特效图片特效时间特效-1-附录BJavaScript特效制作与欣赏第1部分文字特效1.文字逐个闪烁1.代码输入在body/body标签区域中输入以下代码。bodyscriptlanguage=JavaScript!--Begintext=文字逐个闪烁;//显示的文字color1=blue;//文字的颜色color2=red;//转换的颜色fontsize=10;//字体大小speed=200;//转换速度(1000=1秒)i=0;if(navigator.appName==Netscape){document.write(layerid=avisibility=show/layerbrbrbr);}else{document.write(divid=a/div);}functionchangeCharColor(){if(navigator.appName==Netscape){document.a.document.write(centerfontface=arialsize=+fontsize+fontcolor=+color1+);for(varj=0;jtext.length;j++){if(j==i){document.a.document.write(fontface=arialcolor=+color2++Text.charAt(i)+/font);}else{document.a.document.write(text.charAt(j));}}document.a.document.write('/font/font/center');document.a.document.close();}-2-if(navigator.appName==MicrosoftInternetExplorer){str=centerfontface=arialsize=+fontsize+fontcolor=+color1+;for(varj=0;jtext.length;j++){if(j==i){str+=fontface=arialcolor=+color2++text.charAt(i)+/font;}else{str+=text.charAt(j);}}str+=/font/font/center;a.innerHTML=str;}(i==text.length)?i=0:i++;}setInterval(changeCharColor(),speed);//End--/script/body2.效果展示2.旋转变换文字1.代码输入在head/head标签区域中输入以下代码。SCRIPTlanguage=javascript附录-3-附录BJavaScript特效制作与欣赏//luxiaoqingPhrase=欢迎光临!Balises=Taille=40;Midx=100;Decal=0.5;Nb=Phrase.length;y=-10000;for(x=0;xNb;x++){Balises=Balises+'DIVId=L'+x+'STYLE=width:3;font-family:CourierNew;font-weight:bold;position:absolute;top:40;left:50;z-index:0'+Phrase.charAt(x)+'/DIV'}document.write(Balises);Time=window.setInterval(Alors(),10);Alpha=5;I_Alpha=0.05;functionAlors(){Alpha=Alpha-I_Alpha;for(x=0;xNb;x++){Alpha1=Alpha+Decal*x;Cosine=Math.cos(Alpha1);Ob=document.all(L+x);Ob.style.posLeft=Midx+100*Math.sin(Alpha1)+50;Ob.style.zIndex=20*Cosine;Ob.style.fontSize=Taille+25*Cosine;Ob.style.color=rgb(+(27+Cosine*80+50)+,+(127+Cosine*80+50)+,0);}}/SCRIPT2.效果展示3.淡入淡出文字-4-1.代码输入步骤1:在head/head标签区域中输入以下代码。scriptlanguage=javaScript!--functioncheckBrowserForVersion4(){varx=navigator.appVersion;y=x.substring(0,4);if(y=4)Effect();}varisNav=(navigator.appName.indexOf(Netscape)!=-1);varcolors=newArray(FFFFFF,FFFFFF,FFFFFF,FFFFFF,FFFFFF,FFFFFF,FFFFFF,F9F9F9,F1F1F1,E9E9E9,E1E1E1,D9D9D9,D1D1D1,C9C9C9,C1C1C1,B9B9B9,B1B1B1,A9A9A9,A1A1A1,999999,919191,898989,818181,797979,717171,696969,616161,595959,515151,494949,414141,393939,313131,292929,212121,191919,111111,090909,000000)a=0,b=1functionEffect(){color=colors[a];aa=fontsize='10'fontface='Arial,Helvetica,sans-serif'fontcolor=+color+Welcome!pEnjoyyourtime/font/font/fontif(isNav){document.object1.document.write(aa);document.object1.document.close();}elseobject1.innerHTML=aaa+=b;if(a==38)b-=2;if(a==0)b+=2;xx=setTimeout(Effect(),10);}//--/script步骤2:在body/body标签区域中输入以下代码。bodyonload=checkBrowserForVersion4()divid=object1style=position:absolute;visibility:show;left:181px;top:113px;z-index:2/div2.效果展示附录-5-附录BJavaScript特效制作与欣赏第2部分菜单特效1.左键弹出式菜单1.代码输入步骤1:在head/head标签区域中输入以下代码。styletype=text/cssbody{font:9pt宋体;margintop:0px;color:#000000;background:#ffffff}a.{font:9pt宋体;cursor:hand;font-size:9pt;color:#000000;text-decoration:none}a:active{font:9pt宋体;cursor:hand;color:#FF0033}a.cc:hover{font:9pt宋体;cursor:hand;color:#FF0033}.box{font:9pt宋体;position:absolute;background:#ffffff}/style步骤2:在body/body标签区域中输入以下代码。tableid=itemopenclass=boxstyle=display:nonetrtdahref=#class=cc本站首页/a/td/trtrtdahref=#class=cc最近更新/a/td/trtrtdahref=#class=cc软件下载/a/td/trtrtdahref=#class=cc壁纸下载/a/td/trtrtdahref=#class=cc更多连接/a/td/trtrtdahref=#class=cc更多连接/a/td/trtrtdahref=popmenu.htmclass=cc更多连接/a/td/tr/table-6-/center/div!--EndofPopupMenu--scriptlanguage=JavaScriptdocument.onclick=popUpfunctionpopUp(){newX=window.event.x+document.body.scrollLeftnewY=window.event.y+document.body.scrollTopmenu=document.all.itemopenif(menu.style.display==){menu.style.display=none}else{menu.style.display=}menu.style.pixelLeft=newX-50menu.style.pixelTop=newY-50}/script2.效果展示2.推拉门式菜单1.代码输入步骤1:在head/head标签区域中输入以下代码。styletype=text/css!--.link{color:#000000;text-decoration:none;}A.link:hover{color:red;附录-7-附录BJavaScript特效制作与欣赏}A.link:active{color:#000000;text-decoration:none;}//--/stylestyletype=text/css!--#slidemenubar2{position:absolute;left:-110pt;width:120pt;top:100pt;border:1.5ptsolidblack;background-color:#ffffff;layer-background-color:#ffffff;font:9pt/20pt宋体;}body{font-size:9pt;margin:0pt}#slidemenubar{position:absolute;left:-110pt;width:120pt;top:100pt;border:1.5ptblacksolid;background-color:#F3F3F3;layer-background-color:lightyellow;font:9pt/20pt宋体;}//--/style步骤2:在body/body标签区域中输入以下代码。scriptlanguage=JavaScript1.2if(document.all)document.write('divid=slidemenubar2style=left:-100onMouseover=pull()onMouseout=draw()')/scriptlayerid=slidemenubaronMouseover=pull()onMouseout=draw()scriptlanguage=JavaScript1.2varsitems=newArray()varsitemlinks=newA