`
lhb3015
  • 浏览: 9368 次
  • 性别: Icon_minigender_1
  • 来自: 杭州
文章分类
社区版块
存档分类
最新评论

网页特效、JavaScript经典效果

阅读更多
一 些很实用且必用的小脚本代码:

脚本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>
脚本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>
三 如果文字过长,则将过长的部分变成省略号显示
<DIV STYLE="width: 120px; height: 50px; border: 1px solid blue;
overflow: hidden; text-overflow:ellipsis">
<NOBR>就是比如有一行文字,很长,表格内一行显示不下.</NOBR>
</DIV>
十二 运行代码的代码:
<script>
function Preview()
{
var TestWin=open('');
TestWin.document.write(code.value);
}
</script>
<textarea id=code cols=60 rows=15>在这里输入代码</textarea>
<br>
<button onclick=Preview() >运行</button>
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics