1、收藏本站
说明 点击即可把你的网站添加到浏览器的收藏菜单下
代码
<span style="CURSOR: hand" onClick="window.external.addFavorite('http://www.sogowang.com','搜索网')" title="搜索网">收藏本站</span>
2.设为首页
说明 点击即可把你的网站设置为浏览器的起始页
代码
<span onclick="var strHref=window.location.href;this.style.behavior='url(#default#homepage)';this.setHomePage('http://www.sogowang.com');" style="CURSOR: hand">设为首页</span>
3.自动关闭窗口
说明 在网页源代码中加入下面的代码,则该窗口将在20秒钟之后自动关闭!这与跳出式小窗口配合使用是再好不过啦!代码中“i=20”表示关闭的延迟时间为20秒,可任意修改。
代码
<script language="javascript">
<!--
function clock(){i=i-1
document.title="本窗口将在"+i+"秒后自动关闭!";
if(i>0)setTimeout("clock();",1000);
else self.close();}
var i=20
clock();
//-->
</script>
4.跳出小窗口
说明 在打开有下面这段代码的页面时将会跳出一个468x60大小的小窗口。“window.html”为跳出的小窗口里所要显示的网页。toolbar、status、menubar、scrollbars、设置小窗口的工具栏、状态栏、菜单栏及滚动条的有无,resizable设置是否可让浏览者改变小窗口大小,width、height设置小窗口的宽度以及高度。(不过这样的小窗口一般是不受欢迎的哦!)
代码
<script language="JavaScript">
window.open("window.html","www_helpor_net","toolbar=no, status=no,menubar=no, scrollbars=no,resizable=no,width=468,height=60,left=200,top=50");
</script>
5.固定字号大小
说明 你是否有过这样的经历:一个布置得很好的网页,当浏览时把浏览器的字号设置成大或小时,漂亮的网页马上面目全非了。因为字的大小变了,版式自然乱了。现在好了,只要把下面这段代码加入到网页源文件的<head>与</head>之间就行了(对用<font>标签定义的文字无效)。
代码
<style type="text/css">
<!--
body {font-size:9pt}
td {font-size:9pt}
-->
</style>
6、文本自动向上循环滚动
说明: 文本自动向上循环滚动,鼠标放到上面还会暂时停下来。
代码:
<table border="1" bordercolor="#000000" bgcolor="#6699ff" cellpadding="5" cellspacing="0">
<tr>
<td>
<script language=javascript>
document.write ("<marquee scrollamount='1' scrolldelay='30' direction= 'UP' width='200' id='helpor_net' height='150' onmouseover='helpor_net.stop()' onmouseout='helpor_net.start()' Author:redriver; For more,visit:www.helpor.net>")
document.write ("<h2><p align='center'><font color='#ffffff' face='黑体'>偶 然</font></h2>")
document.write ("<p align='right'><a href='#' target='_blank'><font color='#ffffff'>徐志摩</font></a> ")
document.write ("<p><font color='#ffffff'> ")
document.write ("<br>我是天空里的一片云,")
document.write ("<br>偶尔投影在你的波心?? ")
document.write ("<br>你不必讶异, ")
document.write ("<br>更无须欢喜?? ")
document.write ("<br>在转瞬间消灭了踪影。")
document.write ("<br>")
document.write ("<br>你我相逢在黑暗的海上,")
document.write ("<br>你有你的,我有我的,方向;")
document.write ("<br>你记得也好, ")
document.write ("<br>最好你忘掉, ")
document.write ("<br>在这交会时互放的光亮! ")
document.write ("</font>")
document.write ("</marquee> ")
</script>
</td>
</tr>
</table>
7、 舞台光柱照射的效果
说明: 页面产生舞台光柱照射的效果
代码:
<body bgcolor="#000000" id="www_helpor_net" style="position: relative; left: 0px; color: White; filter: light">
<script language="VBScript">
Option Explicit
sub window_OnLoad()
call www_helpor_net.filters.light(0).addambient(0,0,255,30)
call www_helpor_net.filters.light(0).addcone(400,400,200,100,100,200,204,200,80,10)
end sub
sub document_onMouseMove()
call www_helpor_net.filters.light(0).MoveLight(1,window.event.x,window.event.y,0,1)
end sub
</script>
8、 百页窗的效果
说明 进入页面时,页面产生百页窗似的的效果
代码
<style>
<!--
.helpor_net{position:absolute;
left:0;
top:0;
layer-background-color:#3399ff;
background-color:#3399ff;
border:0.1px solid green
}
-->
</style>
<div id="i1" class="helpor_net"></div><div id="i2" class="helpor_net"></div><div id="i3"
class="helpor_net"></div><div id="i4" class="helpor_net"></div><div id="i5" class="helpor_net"></div><div
id="i6" class="helpor_net"></div><div id="i7" class="helpor_net"></div><div id="i8" class="helpor_net"></div>
<SCRIPT language=javascript>
<!--
var speed=30
var temp=new Array()
var temp2=new Array()
if (document.layers){
for (i=1;i<=8;i++){
temp[i]=eval("document.i"+i+".clip")
temp2[i]=eval("document.i"+i)
temp[i].width=window.innerWidth/8-0.3
temp[i].height=window.innerHeight
temp2[i].left=(i-1)*temp[i].width
}
}
else if (document.all){
var clipbottom=document.body.offsetHeight,cliptop=0
for (i=1;i<=8;i++){
temp[i]=eval("document.all.i"+i+".style")
temp[i].width=document.body.clientWidth/8
temp[i].height=document.body.offsetHeight
temp[i].left=(i-1)*parseInt(temp[i].width)
}
}
function openit(){
window.scrollTo(0,0)
if (document.layers){
for (i=1;i<=8;i=i+2)
temp[i].bottom-=speed
for (i=2;i<=8;i=i+2)
temp[i].top+=speed
if (temp[2].top>window.innerHeight)
clearInterval(stopit)
}
else if (document.all){
clipbottom-=speed
for (i=1;i<=8;i=i+2){
temp[i].clip="rect(0 auto+"+clipbottom+" 0)"
}
cliptop+=speed
for (i=2;i<=8;i=i+2){
temp[i].clip="rect("+cliptop+" auto auto)"
}
if (clipbottom<=0)
clearInterval(stopit)
}
}
function www_helpor_net(){
stopit=setInterval("openit()",100)
}
www_helpor_net()
-->
</SCRIPT>
9、 文本自动向上循环滚动
说明: 文本自动向上循环滚动,鼠标放到上面还会暂时停下来。
代码:
<DIV class=ttl1 id=ttl0><SPAN class=ttl1></SPAN></DIV>
<SCRIPT language="JavaScript">
<!--
var layers = document.layers, style = document.all, both = layers || style, idme=908601;
if (layers) { layerRef = 'document.layers'; styleRef = ''; } if (style) { layerRef = 'document.all'; styleRef = '.style'; }
function writeOnText(obj, str) {
if (layers) with (document[obj]) { document.open(); document.write(str); document.close(); }
if (style) eval(obj+'.innerHTML= str');
}
//以下是输出的内容,自己修改即可。
var dispStr = new Array(
"<font color=red size=3>欢迎光临...</font>"
);
var overMe=0;
function helpor_net(str, idx, idObj, spObj, clr1, clr2, delay, plysnd) {
var tmp0 = tmp1 = '', skip = 0;
if (both && idx <= str.length) {
if (str.charAt(idx) == '<') { while (str.charAt(idx) != '>') idx++; idx++; }
if (str.charAt(idx) == '&' && str.charAt(idx+1) != ' ') { while (str.charAt(idx) != ';') idx++; idx++; }
tmp0 = str.slice(0,idx);
tmp1 = str.charAt(idx++);
if (overMe==0 && plysnd==1) {
if (navigator.plugins[0]) {
if (navigator.plugins["LiveAudio"][0].type=="audio/basic" && navigator.javaEnabled()) {
document.embeds[0].stop();
setTimeout("document.embeds[0].play(false)",100); }
} else if (document.all) {
ding.Stop();
setTimeout("ding.Run()",100);
}
overMe=1;
} else overMe=0;
writeOnText(idObj, "<span class="+spObj+"><font color='"+clr1+"'>"+tmp0+"</font><font color='"+clr2+"'>"+tmp1+"</font></span>");
setTimeout("helpor_net('"+str+"', "+idx+", '"+idObj+"', '"+spObj+"', '"+clr1+"', '"+clr2+"', "+delay+" ,"+plysnd+")",delay);
}
}
function www_helpor_net() {
helpor_net(dispStr[0], 0, 'ttl0', 'ttl1', '#339933', '#99FF33', 50, 0);
}
www_helpor_net();
// -->
</SCRIPT>
10、字符慢慢隐现
说明: 字符慢慢隐现
代码:
<body bgcolor="#FFFFFF" id="www_helpor_net">
<div id="helpor_net" style="visibility:visible;width:400px;height:30px;text-align:center; font-family:隶书;font-size:30pt;color:6699ff"></div>
<SCRIPT language="JavaScript">
<!--
var thissize=20
var textfont="隶书"
var textcolor= new Array()
textcolor[0]="000000"
textcolor[1]="000000"
textcolor[2]="000000"
textcolor[3]="111111"
textcolor[4]="222222"
textcolor[5]="333333"
textcolor[6]="444444"
textcolor[7]="555555"
textcolor[8]="666666"
textcolor[9]="777777"
textcolor[10]="888888"
textcolor[11]="999999"
textcolor[12]="aaaaaa"
textcolor[13]="bbbbbb"
textcolor[14]="cccccc"
textcolor[15]="dddddd"
textcolor[16]="eeeeee"
textcolor[17]="ffffff"
textcolor[18]="ffffff"
var message = new Array()
message[0]="欢迎光临、、、、、、"
message[1]="多停留一会儿"
message[2]="你会有更多的收获"
message[3]="请再次光临"
i_message=0
var i_strength=0
var i_message=0
var timer
function www_helpor_net() {
if(document.all) {
if (i_strength <=17) {
helpor_net.innerText=message[i_message]
document.all.helpor_net.style.filter="glow(color="+textcolor[i_strength]+", strength=4)"
i_strength++
timer=setTimeout("www_helpor_net()",100)
}
else {
clearTimeout(timer)
setTimeout("dewww_helpor_net()",1500)
}
}
}
function dewww_helpor_net() {
if(document.all) {
if (i_strength >=0) {
helpor_net.innerText=message[i_message]
document.all.helpor_net.style.filter="glow(color="+textcolor[i_strength]+", strength=4)"
i_strength--
timer=setTimeout("dewww_helpor_net()",100)
}
else {
clearTimeout(timer)
i_message++
if (i_message>=message.length) {i_message=0}
i_strength=0
intermezzo()
}
}
}
function intermezzo() {
helpor_net.innerText=""
setTimeout("www_helpor_net()",1000)
}
www_helpor_net();
//-->
</SCRIPT>
你可以使用这个链接引用该篇文章 http://publishblog.blogchina.com/blog/tb.b?diaryID=3756288