當前位置:才華齋>設計>網頁設計>

JavaScript經典效果集錦

網頁設計 閱讀(3.1W)

些很實用且必用的小指令碼程式碼:

JavaScript經典效果集錦

指令碼1:進入主頁以後自動播放聲音

指令碼2:進入主頁後自動最大話,省的去在自己單擊了

To(0,0)

zeTo(lWidth,lHeight)

指令碼3:顯示現在時間的指令碼

enow

指令碼4:顯示最後修改時間的.指令碼

e(Modified)

指令碼5:設為首頁,加為收藏,加入頻道,啟動outlook發信

<astyle="cursor:hand"

onclick="vior="url(#default#homepage)";

omePage("yourURL">設為首頁

<astyle="cursor:hand"

onclick="avorite(,e);">加入收藏

加入頻道

與我聯絡

指令碼6:狀態列動態顯示現在時間

functionsee(){

imeout("see()",1000);

today=newDate();

us=ring();

}

指令碼7:關閉視窗的指令碼

[關閉視窗]

指令碼8:按下F12鍵,直接返回首頁

functionlook(){ if(ode==123){=~kayvin/} } if(ydown==null) {ydown=look}

指令碼9:後退,重新整理,前進

複製程式碼 程式碼如下:

指令碼10:設定時間彈出視窗,4000=4秒,當然你可以自定義

複製程式碼 程式碼如下:

functionl(){ ("yourURL","name","width=500,height=150,border=0") } setTimeout("l()",4000)

二滑鼠旁邊的提示資訊,類似與163登入後的頁面提示效果

tip //***********預設設定定義.********************* tPopWait=50;//停留tWait豪秒後顯示提示。 tPopShow=5000;//顯示tShow豪秒後關閉提示 showPopStep=20; popOpacity=99; //***************內部變數定義***************** sPop=null; curShow=null; tFadeOut=null; tFadeIn=null; tFadeWaiting=null; e(""); e("Text { background-color: #F8F8F5;color:#000000; border: 1px #000000 solid;font-color: font-size: 12px; padding-right: 4px; padding-left: 4px; height: 20px; padding-top: 2px; padding-bottom: 2px; filter: Alpha(Opacity=0)}"); e(""); e(""); function showPopupText(){ var o=lement; MouseX=event.x; MouseY=event.y; if(!=null && !=""){p=;=""}; if(e!=null && e!=""){p=e;e=""}; if(p!=sPop) { sPop=p; clearTimeout(curShow); clearTimeout(tFadeOut); clearTimeout(tFadeIn); clearTimeout(tFadeWaiting); if(sPop==null || sPop=="") { rHTML=""; er="Alpha()"; ity=0; } else { if(ass!=null) popStyle=ass else popStyle="cPopText"; curShow=setTimeout("showIt()",tPopWait); } } } function showIt(){ sName=popStyle; rHTML=sPop; popWidth=ntWidth; popHeight=ntHeight; if(MouseX+12+popWidth>ntWidth) popLeftAdjust=-popWidth-24 else popLeftAdjust=0; if(MouseY+12+popHeight>ntHeight) popTopAdjust=-popHeight-24 else popTopAdjust=0; =MouseX+12+llLeft+popLeftAdjust; =MouseY+12+llTop+popTopAdjust; er="Alpha(Opacity=0)"; fadeOut(); } function fadeOut(){ if(ity0) { ity-=1; tFadeIn=setTimeout("fadeIn()",1); } } useover=showPopupText;

[Ctrl+A 全選 注:如需引入外部Js需重新整理才能執行]