常用代码3

作者在 2006-06-18 05:04:00 发布以下内容
将你的网站设为浏览器的首页
只要在页面适当位置加入如下语句,并将“http://www.sujiatun.com/dvbbs/index.htm”替换为你的网址.
<a href="#" onclick="this.style.behavior='url(#default #homepage)';this.setHomePage('http://www.sujiatun.com/dvbbs/index.htm);">将本站设为首页</a>

将你的网站添加到收藏夹
<a href="javascript:window.external.Addfavorite('http://www.sujiatun.com/dvbbs/index.htm','网站名称')">将本站添加到收藏夹</a>

将你的网站添加到频道
首先, 你要制作自己的频道文件, 然后在网页中加入以下语句, 并将“http://www.sujiatun.com/dvbbs/index.htm”替换为你的频道文件的位置.
<a href="javascript:window.external.addChannel('http://www.sujiatun.com/dvbbs/index.htm')">将本站加入你的频道中</a>

查看上一页/下一页
在页面适当位置加入以下语句, 可以进行页面的切换.
<a href="javascript:history.back()">上一页</a>
<a href="javascript:history.forward()">下一页</a>

定时转向页面
在页面<head>内加入以下语句, 并将“http://www.sujiatun.com/dvbbs/index.htm”替换为要转向的网址或主页.
<meta http-equiv="refresh" content="5;url=http://www.sujiatun.com/dvbbs/index.htm">
其中,content="5;中的5为停顿时间(5秒).

窗口的打开/关闭
在页面<head>内加入以下语句, 并将“http://www.sujiatun.com/dvbbs/index.htm”替换为要打开的网址或主页. 打开一个页面的同时弹出一窗口, 并在一分钟后自动关闭.
<script language="javascript">
var newWin=***********("http://www.sujiatun.com/dvbbs/index.htm";,"NEWWIN","status=no,toolbar=no,scrollbars=no,location=no ,menu=no,resizable=no,width=400,height=300")
if (newWin){
setTimeout('newWin.close();', 60000)
}
</script>
其中,('newWin.close();', 60000)中的60000为等候时间(60秒), 单位为毫秒. 若不想自动关闭,请将以下语句删除:
if (newWin){
setTimeout('newWin.close();', 60000)
}

当前窗口的关闭
只要在页面适当位置加入如下语句.
<a href="javascript:window.close()">关闭窗口</a>

在状态栏中显示文字链接的说明
<a href="http://www.suhu.com"; onmouseOver="window.status='优秀的中文搜索引擎';return true;" onmouseOut="window.status='';">搜狐</a>
当鼠标指向搜狐这一链接时,在状态栏中将显示“优秀的中文搜索引擎”信息,鼠标移走,状态栏中的信息清空。

取消文字链接的下划线
在页面<head>内加入以下语句, 所有页面上的文字链接的下划线都取消。当鼠标指向链接时,下划线(红色)才显示(Netscape没有此功能)。
<style TYPE="text/css">
a {text-transform: none; text-decoration: none;}
a:hover {text-decoration: underline; color:red;}
</style>

保护你的页面不被它人放在框架中
为了保护你的页面,请在页面<head>内加入以下语句.
<script language="javascript">
if(self!=top){top.location=self.location;}
</script>

改变行距
在页面<head>内加入以下语句, 所有以<P>开头以</P>结尾的段落,行高将是本身字体大小的150%.
<style type="text/css">
P{line-height:150%}
</style>
在页面如下设置:
<P>这是第一行</P>
<P>这是第二行</P>

文本框自动滚动条
<textarea name=words rows=18 cols=26 style="border:1 solid #000000;background-color:white; font-size:9pt; width:188; overflow:auto" wrap=hard>

宝贝资料 | 阅读 1748 次
文章评论,共0条
游客请输入验证码