谁沉冥到,那无边的深,将热爱着,这最生动的生

.net 2.0 c#学习

导航

实用Javascript代码段

字号缩放

让文字大点,让更多的用户看的更清楚。(也可以把字体变为百分比来实现)

<script type="text/javascript">
function doZoom(size)
{document.getElementById('zoom').style.fontSize=size+'px';}
</script>
<span id="zoom">需要指定大小的文字</span>
<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)
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来解决,不至于影响美观

posted on 2006-10-12 10:43  天若有情  阅读(211)  评论(0编辑  收藏  举报