Maison  >  Article  >  interface Web  >  一些很实用且必用的小脚本代码第1/5页_javascript技巧

一些很实用且必用的小脚本代码第1/5页_javascript技巧

PHP中文网
PHP中文网original
2016-05-16 19:27:181012parcourir

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

脚本3:显示现在时间的脚本 

 

脚本4:显示最后修改时间的脚本 

<script>document.write(document.lastModified)</script> 

脚本5:设为首页,加为收藏,加入频道,启动outlook发信 

onclick="this.style.behavior="url(#default#homepage)";
this.setHomePage(http://www.php.cn/);">">设为首页
 

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://www.php.cn/~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>

当前1/5页 12345下一页阅读全文

Déclaration:
Le contenu de cet article est volontairement contribué par les internautes et les droits d'auteur appartiennent à l'auteur original. Ce site n'assume aucune responsabilité légale correspondante. Si vous trouvez un contenu suspecté de plagiat ou de contrefaçon, veuillez contacter admin@php.cn