JavaScript經典效果

時間:2024-09-22 00:06:21 JavaScript 我要投稿

JavaScript經典效果集錦

  些很實用且必用的小腳本代碼:

  腳本1:進入主頁以后自動播放聲音

  腳本2:進入主頁后自動最大話,省的去在自己單擊了

  self.moveTo(0,0)

  self.resizeTo(screen.availWidth,screen.availHeight)

  腳本3:顯示現在時間的腳本

  document.writenow

  腳本4:顯示最后修改時間的腳本

  document.write(document.lastModified)

  腳本5:設為首頁,加為收藏,加入頻道,啟動outlook發信

  <astyle="cursor:hand"

  onclick="this.style.behavior="url(#default#homepage)";

  this.setHomePage("yourURL">設為首頁

  <astyle="cursor:hand"

  onclick="window.external.AddFavorite(location.href,document.title);">加入收藏

  加入頻道

  與我聯系

  腳本6:狀態欄動態顯示現在時間

  functionsee(){

  window.setTimeout("see()",1000);

  today=newDate();

  self.status=today.toString();

  }

  腳本7:關閉窗口的腳本

  [關閉窗口]

  腳本8:按下F12鍵,直接返回首頁

  functionlook(){ if(event.keyCode==123){document.location.href=http://10.13.31.90/~kayvin/} } if(document.onkeydown==null) {document.onkeydown=look}

  腳本9:后退,刷新,前進

  復制代碼 代碼如下:

  腳本10:設定時間彈出窗口,4000=4秒,當然你可以自定義

  復制代碼 代碼如下:

  functionl(){ window.open("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; document.write(""); document.write(".cPopText { 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)}"); document.write(""); document.write(""); function showPopupText(){ var o=event.srcElement; MouseX=event.x; MouseY=event.y; if(o.alt!=null && o.alt!=""){o.dypop=o.alt;o.alt=""}; if(o.title!=null && o.title!=""){o.dypop=o.title;o.title=""}; if(o.dypop!=sPop) { sPop=o.dypop; clearTimeout(curShow); clearTimeout(tFadeOut); clearTimeout(tFadeIn); clearTimeout(tFadeWaiting); if(sPop==null || sPop=="") { dypopLayer.innerHTML=""; dypopLayer.style.filter="Alpha()"; dypopLayer.filters.Alpha.opacity=0; } else { if(o.dyclass!=null) popStyle=o.dyclass else popStyle="cPopText"; curShow=setTimeout("showIt()",tPopWait); } } } function showIt(){ dypopLayer.className=popStyle; dypopLayer.innerHTML=sPop; popWidth=dypopLayer.clientWidth; popHeight=dypopLayer.clientHeight; if(MouseX+12+popWidth>document.body.clientWidth) popLeftAdjust=-popWidth-24 else popLeftAdjust=0; if(MouseY+12+popHeight>document.body.clientHeight) popTopAdjust=-popHeight-24 else popTopAdjust=0; dypopLayer.style.left=MouseX+12+document.body.scrollLeft+popLeftAdjust; dypopLayer.style.top=MouseY+12+document.body.scrollTop+popTopAdjust; dypopLayer.style.filter="Alpha(Opacity=0)"; fadeOut(); } function fadeOut(){ if(dypopLayer.filters.Alpha.opacity0) { dypopLayer.filters.Alpha.opacity-=1; tFadeIn=setTimeout("fadeIn()",1); } } document.onmouseover=showPopupText;

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

【JavaScript經典效果】相關文章:

有關javascript實現的多個層切換效果通用函數示例10-07

對javascript的理解08-08

常用的JavaScript模式09-22

Javascript的this用法簡述08-15

JavaScript學習筆記08-24

JavaScript 基礎教學09-29

JavaScript的課堂講解09-03

JavaScript常用方法匯總10-25

JavaScript數組常用方法介紹09-04

JavaScript中的with關鍵字07-24

亚洲制服丝袜二区欧美精品,亚洲精品无码视频乱码,日韩av无码一区二区,国产人妖视频一区二区
亚洲性爱视频久久 | 日韩精品中文在线一区二区 | 日韩国产网站一区 | 精品国产丁香五月天在线观看 | 亚洲国产aⅴ成人精品无吗 亚洲综合色自拍一区 | 亚洲精品第一国产野狼 |