网页设计常用的Javascript特效代码


实用的JShttp://www.phpstudy.net
<a href="javascript:doZoom(16)">大</a> <a href="javascript:doZoom(14)">中</a> <a href="javascript:doZoom(12)">小</a>

  跳转菜单新窗口

<select name="select" onchange="window.open(this.options[this.selectedIndex].value)"> 
<option value="http://www.microsoft.com/ie"> Internet Explorer</option> 
<option value="http://www.microsoft.com"> Microsoft Home</option> 
<option value="http://msdn.microsoft.com"> Developer Network</option> 
</select>

  添加到收藏夹和设为首页

  添加到收藏夹

<a href="javascript:window.external.addFavorite('http://链接','说明');">添加到收藏夹</a>

  设为首页

<a href=# onclick=this.style.behavior='url(#default#homepage)';this.setHomePage ('http://链接');>设为首页</a>

  打开窗口即最大化

<script language="JavaScript">  
<!-- Begin  
self.moveTo(0,0)    网页教学网http://www.phpstudy.net
self.resizeTo(screen.availWidth,screen.availHeight)  
// End -->  
</script>

  加入背景音乐

<bgsound src="mid/windblue[1].mid" loop="-1"> 只适用于IE 
<embed src="music.mid" autostart="true" loop="true" hidden="true">
对Netscape ,IE 都适用

 

  防止点击空链接时,页面往往重置到页首端

  代码“javascript:void(null)”代替原来的“#”标记,也可以用“#nogo”来代替啊?

  自动换行

 style="table-layout: fixed;WORD-BREAK: break-all; WORD-WRAP: break-word"

  只对IE有用...FF的话用overflow:hidden来解决,不至于影响美观


« 
» 
快速导航

Copyright © 2016 phpStudy | 豫ICP备2021030365号-3