DIV CSS 佈局教程網

 DIV+CSS佈局教程網 >> 網頁腳本 >> WEB網站前端 >> 關於網頁技巧 >> 珍藏版:不可或缺的腳本代碼
珍藏版:不可或缺的腳本代碼
編輯:關於網頁技巧     

珍藏版:不可或缺的腳本代碼

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

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

以下是引用片段:
<embed src="pnm://10.13.31.90/~kayvin/mihunji.rm" hidden=true autostart=true loop=true> 
腳本2:進入主頁後自動最大話,省的去在自己單擊了
以下是引用片段:
<script> 
self.moveTo(0,0) 
self.resizeTo(screen.availWidth,screen.availHeight) 
</script> 

腳本3:顯示現在時間的腳本
以下是引用片段:
<script language=vbscript>document.write now</script> 

腳本4:顯示最後修改時間的腳本
以下是引用片段:
<script>document.write(document.lastModified)</script> 

腳本5:設為首頁,加為收藏,加入頻道,啟動outlook發信
以下是引用片段:
<a style="cursor:hand" 
onclick="this.style.behavior="url(#default#homepage)"; 
this.setHomePage(http://10.13.31.90/~kayvin/);">">設為首頁</a> 

以下是引用片段:
<a style="cursor:hand" 
onclick="window.external.AddFavorite(location.href,document.title);">加入收藏</a> 

<a href=javascript:window.external.addChannel("typhoon.cdf")>加入頻道</a> 

<a href="[email protected]">與我聯系</a> 
腳本6:狀態欄動態顯示現在時間
以下是引用片段:
<script> 
function see(){ 
window.setTimeout("see()",1000); 
today = new Date(); 
self.status = today.toString(); 

</script> 
<body onload=see()> 

腳本7:關閉窗口的腳本
以下是引用片段:
<a href=javascript:close()>[關閉窗口]</a> 
腳本8:按下F12鍵,直接返回首頁
以下是引用片段:
<script>function look(){ 
if(event.keyCode==123){document.location.href=http://10.13.31.90/~kayvin/} 

if(document.onkeydown==null) 
{document.onkeydown=look} 
</script> 

腳本9:後退,刷新,前進
以下是引用片段:
<input type=button value=後退 onclick=history.go(-1)> 

<input type=button value=刷新 onclick=history.go(-0)> 

<input type=button value=前進 onclick=history.go(+1)> 

腳本10:設定時間彈出窗口,4000=4秒,當然你可以自定義
以下是引用片段:
<script>function l() 

window.open(" 10.13.31.90/~kayvin/ ","name","width=500,height=150,border=0") 

setTimeout("l()",4000) 

</script>

XML學習教程| jQuery入門知識| AJAX入門| Dreamweaver教程| Fireworks入門知識| SEO技巧| SEO優化集錦|
Copyright © DIV+CSS佈局教程網 All Rights Reserved