Home  >  Article  >  Web Front-end  >  些很实用且必用的小脚本代码_JavaScript

些很实用且必用的小脚本代码_JavaScript

WBOY
WBOYOriginal
2016-05-16 19:28:491075browse

脚本1:进入主页以后自动播放声音 
 

脚本2:进入主页后自动最大话,省的去在自己单击了 
<script> <BR>self.moveTo(0,0) <BR>self.resizeTo(screen.availWidth,screen.availHeight) <BR></script> 

脚本3:显示现在时间的脚本 
<script>document.write now</script> 

脚本4:显示最后修改时间的脚本 
<script>document.write(document.lastModified)</script> 

脚本5:设为首页,加为收藏,加入频道,启动outlook发信 
onclick="this.style.behavior="url(#default#homepage)"; 
this.setHomePage(http://10.13.31.90/~kayvin/);">">设为首页
 

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

加入频道 

与我联系 

脚本6:状态栏动态显示现在时间 
<script> <BR>function see(){ <BR>window.setTimeout("see()",1000); <BR>today = new Date(); <BR>self.status = today.toString(); <BR>} <BR></script> 
 

脚本7:关闭窗口的脚本 
[关闭窗口] 

脚本8:按下F12键,直接返回首页 
<script>function look(){ <BR>if(event.keyCode==123){document.location.href=http://10.13.31.90/~kayvin/} <BR>} <BR>if(document.onkeydown==null) <BR>{document.onkeydown=look} <BR></script> 

脚本9:后退,刷新,前进 
 

 

 

脚本10:设定时间弹出窗口,4000=4秒,当然你可以自定义 
<script>function l() <BR>{ <BR>window.open(" 10.13.31.90/~kayvin/ ","name","width=500,height=150,border=0") <BR>} <BR>setTimeout("l()",4000) <br><br></script>
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn