☆ 使 用 说 明 ☆

  • 简介：本软件为Javascript共享教学软件，包含各种Javascript源码及演示，力求丰富易懂。

  • 本软件1.0版本为免费版本，你可以免费使用，自由传播，但请保留其版权。

  • 本软件制作格式：CHM，支持全文检索，可以运行在所有windows操作系统。

  • 注意：由于源代码在制作时已经转化为Html格式，所以如要Copy使用，请先复制到文本文件然后才能使用。有部分网址连接只供演示，并非真实存在，所以不能打开属于正常情况，非软件错误。

   -- 2003/02/28

软件制作：姚辉

Email：yshot@263.net


逐隐逐现的文字特效

逐隐逐现的文字特效[推荐使用][适用于IE4++]
（修改显示的文字后根据说明进行共2步）

====1、以下代码放在一个新建页面的HTML的<body></body>区即可：[页面上必须什么都没有]

<html>
<head>
<TITLE>特效</TITLE>
</head>
<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]="http://www.happydrips.com"
message[1]="HappyDrips工作室"
message[2]="谢谢您使用"
message[3]="javascript源码大全"
i_message=0
var i_strength=0
var i_message=0
var timer
function glowtext() {
if(document.all) {
if (i_strength <=17) {
glowdiv.innerText=message[i_message]
document.all.glowdiv.style.filter="glow(color="+textcolor[i_strength]+", strength=4)"
i_strength++
timer=setTimeout("glowtext()",100)
}
else {
clearTimeout(timer)
setTimeout("deglowtext()",1500)
}
}
}function deglowtext() {
if(document.all) {
if (i_strength >=0) {
glowdiv.innerText=message[i_message]
document.all.glowdiv.style.filter="glow(color="+textcolor[i_strength]+", strength=4)"
i_strength--
timer=setTimeout("deglowtext()",100)
}
else {
clearTimeout(timer)
i_message++
if (i_message>=message.length) {i_message=0}
i_strength=0
intermezzo()
}
}
}
function intermezzo() {
glowdiv.innerText=""
setTimeout("glowtext()",1500)
}
//-->
</script>
<body bgcolor="#000000" onLoad="glowtext()"> //不要忘记写
<div id="glowdiv" style="position:absolute;visibility:visible;width:600px;text-align:center;
top:150px;left:50px;font-family:隶书;font-size:30pt;color:000000"></div>
</body>
</html>

====2、[可选项]修改<div>标签内的代码可以确定文字显示的位置，颜色和大小。
top是距离屏幕上面的距离，left是距离坐侧的距离。font-size是文字大小，
color是颜色。width是DIV层的宽度。由于文字是用DIV来控制的，所以在DIV的宽度范围内不能有其它内容。DIV的位置用绝对位置(position:absolute)表示。

※ 效果演示 ※


特效

 //不要忘记写


超酷的文字特效

超酷的文字特效[特别推荐][共2步]

====1、将以下代码加入HEML的<head></head>之间：

<script>
<!--//
var x,y
var timer
var i_fontsize=0
var step=0
var thisx,thisy
function handlerMM(e){
x = (document.layers) ? e.pageX : event.clientX
y = (document.layers) ? e.pageY : event.clientY
}
function ringup() {
if (document.all) {
thisx = x
thisy = y
ringup2()
}
}
function ringup2() {
if (i_fontsize<=1000) {
document.all.ring.style.fontSize=i_fontsize
document.all.ring.style.color="rgb(255,"+Math.floor(i_fontsize/6)+","+Math.floor(i_fontsize/6)+")"
document.all.ring.style.posLeft=thisx-(Math.floor(i_fontsize/3))
document.all.ring.style.posTop=thisy-(Math.floor(i_fontsize/1.4))
step+=4
i_fontsize+=step
timer=setTimeout("ringup(2)",50)
}
else {
clearTimeout(timer)
i_fontsize=0
step=0
document.all.ring.style.posTop=-10000
}
}
document.onmousemove = handlerMM;
//-->
</script>
<style>
.ringstyle {
position:absolute;
visibility:visible;
top:-50px;
font-size:5pt;
font-family:Verdana;
color:FF0000
}
.explain {
position:absolute;
top:80px;
left:40px;
width:300px;
color:000000;
text-align:center;
font-size:20pt;
font-family:Times;
}
</style>

====2、将以下代码加入HEML的<body></body之间>

<div id="ring" class="ringstyle">
<p><font color="#FF8080">:-)</font></p>
</div><div id="redirection" class="explain">
<p>移动你的鼠标到这里来看看<a target="_blank" onMouseOver="ringup()"
href="http://www.happydrips.com">是不是很棒的效果</a></p>
</div>

※ 效果演示 ※


特效

:-)

移动你的鼠标到这里来看看是不是很棒的效果


特效

阴影文字的特殊效果[适用于IE4++][共3种效果]
放在HTML的<body></body>区即可[适当的位置]：

====1、第一种效果[修改要显示的文字即可]

<div style="width: 350; font-size:15pt; font-family: Arial ; color: red; position: relative; filter:
blur(add=1, direction=45, strength=3)">快乐点滴工作室</div>

====2、第二种效果[修改要显示的文字即可]

<div style="width: 350; font-size:15pt; font-family: Arial ; color: red; position: relative; filter:
glow(color=ffff00, strength=5)">快乐点滴工作室</div>

====3、第三种效果[修改要显示的文字即可]

<div style="width: 350; font-size:15pt; font-family: Arial ; color: red; position: relative; filter:
dropshadow(color=000000, offx=3, offy=3, positive=1)"> 快乐点滴工作室</div>

※ 效果演示 1 2 3 ※


New Page 1

快乐点滴工作室

※ 效果演示 1 2 3 ※


特效

彩色文字的特殊效果[推荐使用]
[根据下面的说明进行修改即可共1步]

====1、以下代码放在HTML的<body></body>区即可：[适当的位置]：

<script language="JavaScript">
<!-- Begin
text = "javascript源码大全"; //显示的文字
color1 = "blue"; //文字的颜色
color2 = "red"; //转换的颜色
fontsize = "8"; //字体大小
speed = 100; //转换速度 (1000 = 1 秒)
i = 0;
if (navigator.appName == "Netscape") {
document.write("<layer id=a visibility=show></layer><br><br><br>");
}
else {
document.write("<div id=a></div>");
}
function changeCharColor() {
if (navigator.appName == "Netscape") {
document.a.document.write("<center><font face=arial size =" + fontsize + "><font color=" + color1 +
">");
for (var j = 0; j < text.length; j++) {
if(j == i) {
document.a.document.write("<font face=arial color=" + color2 + ">" + Text.charAt(i) + "</font>");
}
else {
document.a.document.write(text.charAt(j));
}
}
document.a.document.write('</font></font></center>');
document.a.document.close();
}
if (navigator.appName == "Microsoft Internet Explorer") {
str = "<center><font face=arial size=" + fontsize + "><font color=" + color1 + ">";
for (var j = 0; j < text.length; j++) {
if( j == i) {
str += "<font face=arial color=" + color2 + ">" + text.charAt(i) + "</font>";
}
else {
str += text.charAt(j);
}
}
str += "</font></font></center>";
a.innerHTML = str;
}
(i == text.length) ? i=0 : i++;
}
setInterval("changeCharColor()", speed);
// End -->
</script>

※ 效果演示 ※


特效

升降的文字特殊效果[修改显示的文字即可]
[根据下面的说明进行共1步]

====1、以下代码放在HTML的<body></body>之间[适当的位置]：

<script language="JavaScript">
<!--
done = 0;
step = 4
function anim(yp,yk)
{
if(document.layers) document.layers["napis"].top=yp;
else document.all["napis"].style.top=yp;
if(yp>yk) step = -4
if(yp<60) step = 4
setTimeout('anim('+(yp+step)+','+yk+')', 35);
}
function start()
{
if(done) return
done = 1;
if(navigator.appName=="Netscape") {
document.napis.left=innerWidth/2 - 145;
anim(60,innerHeight - 60)
}
else {
napis.style.left=11;
anim(60,document.body.offsetHeight - 60)
}
}
//-->
</script>
<div id="napis" style="position: absolute;top: -50;color: #000000;font-family:宋体;font-size:9pt;">
<p>
谢谢您的使用！
</p></div>
<script language="JavaScript">
<!--
setTimeout('start()',10);
//-->
</script>

※ 效果演示 ※


New Page 1

谢谢您的使用！


特效

打字效果的文字特效[修改显示的文字即可]
[根据下面的说明进行共1步]

====2、以下代码放在HTML的<body></body>之间[适当的位置]：

<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("javascript源码大全");
var overMe=0;
function txtTyper(str,idx,idObj,spObj,clr1,clr2,delay,plysnd){
var tmp0=tmp1= '',skip=100;
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("txtTyper('"+str+"', "+idx+", '"+idObj+"', '"+spObj+"', '"+clr1+"', '"+clr2+"', "+delay+" ,"+plysnd+")",delay);}}
function init(){txtTyper(dispStr[0], 0, 'ttl0', 'ttl1', '#339933', '#99FF33', 300, 0);}
</script>
<BODY onload=init()>
<DIV class=ttl1 id=ttl0></DIV>
</BODY>

※ 效果演示 ※


特效

淡入淡出的文字效果[根据下面的说明进行共3步]

====1、以下代码放在HTML的<head></head>之间：

<script language="javaScript">
<!--
function checkBrowserForVersion4(){
var x=navigator.appVersion;
y=x.substring(0,4);
if(y>=4) Effect();}
var isNav=(navigator.appName.indexOf("Netscape")!=-1);
var colors=new Array
("FFFFFF","FFFFFF","FFFFFF","FFFFFF","FFFFFF","FFFFFF","FFFFFF","F9F9F9","F1F1F1","E9E9E9","E1E1E1","D9D9D9","D1D1D1","C9C9C9","C1C1C1","B9B9B9","B1B1B1","A9A9A9","A1A1A1","999999","919191","898989","818181","797979","717171","696969","616161","595959","515151","494949","414141","393939","313131","292929","212121","191919","111111","090909","000000")
a=0,b=1
function Effect(){
color=colors[a];
//*改改下面的文字内容即可,可使用HTML语法，但是注意引号不要混用。双引号内是单引号。*//
aa="<font size='5'><font face='Arial, Helvetica, sans-serif'><font color="+color+">Save page and Get Code !<p>Enjoy All These Free Javascripts ......</font></font></font>"
if(isNav) {document.object1.document.write(aa);document.object1.document.close();}
else object1.innerHTML=aa
a+=b;if (a==38) b-=2;if (a==0) b+=2;xx=setTimeout("Effect()",10);}
//-->
</script>

====2、以下代码放在HTML的<body></body>之间[适当的位置]：
<body onload="checkBrowserForVersion4()" >
<div id="object1" style="position:absolute; visibility:show; left:181px; top:113px; z-index:2"></div>

====3、特别说明：只要改变上面的TOP值和LEFT值即可确定文字显示的绝对位置。TOP表示文字距离屏幕顶部的距离（象素），LEFT是离屏幕左侧的距离。上面有一大堆乱七八糟的字符是确定渐变的颜色数组。

※ 效果演示 ※


特效

炽热文字的特殊效果[适用于IE4++]
（根据下面的说明进行共3步）

====1、将以下代码加入HEML的<head></head>之间：

<style>
<!--
#glowtext{
filter:glow(color=red,strength=2);
width:100%;
}
-->
</style>
<script language="JavaScript1.2">
function glowit(which){
if (document.all.glowtext[which].filters[0].strength==2)
document.all.glowtext[which].filters[0].strength=1
else
document.all.glowtext[which].filters[0].strength=2
}
function glowit2(which){
if (document.all.glowtext.filters[0].strength==2)
document.all.glowtext.filters[0].strength=1
else
document.all.glowtext.filters[0].strength=2
}
function startglowing(){
if (document.all.glowtext&&glowtext.length){
for (i=0;i<glowtext.length;i++)
eval('setInterval("glowit('+i+')",150)')
}
else if (glowtext)
setInterval("glowit2(0)",150)
}
if (document.all)
window.onload=startglowing
</script>

====2、将以下代码加入到HEML的<body></body>之间[适当的位置]：

<span id="glowtext">这里是要显示的文字</span>

====3、[可选项]改变文字颜色和背景色可以得到不同的效果。文字颜色修改，只要修改filter:glow(color=red,strength=2); 中的color项,strength为颜色的深度值 。

※ 效果演示 ※


New Page 1

 这里是要显示的文字


特效

状态栏中的文字[修改显示的文字后复制到<body></body>]

<script language=JavaScript>
var MESSAGE="javascript源码大全"
var POSITION=100
var DELAY=5
var scroll=new statusMessageObject()
function statusMessageObject(p,d){
this.msg =MESSAGE
this.out =" "
this.pos =POSITION
this.delay=DELAY
this.i=0
this.reset=clearMessage}
function clearMessage(){
this.pos=POSITION}
function scroller(){
for (scroll.i=0;scroll.i<scroll.pos;scroll.i++){
scroll.out += " "}
if (scroll.pos >= 0)
scroll.out += scroll.msg
else scroll.out=scroll.msg.substring(-scroll.pos,scroll.msg.length)
window.status=scroll.out
scroll.out=" "
scroll.pos--
if (scroll.pos < -(scroll.msg.length)) {
scroll.reset()}
setTimeout('scroller()',scroll.delay)}
function snapIn(jumpSpaces,position){
var msg = scroll.msg
var out = ""
for(var i=0; i<position; i++)
{out+= msg.charAt(i)}
for(i=1;i<jumpSpaces;i++)
{out += " "}
out+=msg.charAt(position)
window.status = out
if(jumpSpaces <= 1) {
position++
if(msg.charAt(position) == ' ')
{position++ }
jumpSpaces = 100-position
}else if (jumpSpaces > 3)
{jumpSpaces *= .75}
else
{jumpSpaces--}
if(position != msg.length) {
var cmd = "snapIn(" + jumpSpaces + "," + position + ")";
scrollID = window.setTimeout(cmd,scroll.delay);
}else{window.status=""
jumpSpaces=0
position=0
cmd = "snapIn(" + jumpSpaces + "," + position + ")";
scrollID = window.setTimeout(cmd,scroll.delay);
return false }
return true}
snapIn(100,0);
</script>

※ 效果演示 ※


特效

不停闪烁的图片[修改显示的图片及链接地址后根据说明进行共1步]

====1、以下代码放在一个新建页面的HTML的<body></body> 区即可：[页面上必须什么都没有]

<HTML>
<HEAD>
<TITLE>Blink image</TITLE>
</HEAD>
<BODY ONLOAD="soccerOnload()" topmargin="0">
<DIV ID="soccer" STYLE="position:absolute; left:150; top:0">
<a href="http://图片的链接.com" target="_blank">
<IMG SRC="要显示的图片.gif" border="0"></a>
</DIV>
<SCRIPT LANGUAGE="JavaScript">
var msecs = 500; //改变时间得到不同的闪烁间隔；
var counter = 0;
function soccerOnload() {
setTimeout("blink()", msecs);
}
function blink() {
soccer.style.visibility =
(soccer.style.visibility == "hidden") ? "visible" : "hidden";
counter +=1;
setTimeout("blink()", msecs);
}
</SCRIPT>
</BODY>
</HTML>

※ 效果演示 ※


特效

图片展示选择[很棒的图片展示脚本所有图片尺寸应该一致才好]

====1、以下代码放在HTML的<body></body> 区即可：

<CENTER>
<img width=200 height=223 src="图片名字.jpg" name="x1">
</CENTER>
//以上是程序初始时显示的图片。
<FORM>
<CENTER>
<SELECT onChange="document.x1.src=options[selectedIndex].value">
<option value="图片名字1.jpg">看看图片1</option>
<option value="图片名字2.jpg">看看图片2</option>
<option value="图片名字3.jpg">看看图片3</option>
<option value="图片名字4.jpg">看看图片4</option>
</SELECT>
</CENTER>
</FORM>

※ 效果演示 ※


特效

图片的渐显播放[推荐][根据下面的说明进行共3步，修改图片的名称及路径即可]
第三步的top:120px;left:240px可以设定显示的位置

====1、将下面的代码插入到HEML的<head></head>之间：

<script language=javaScript>
<!--//
sandra0 = new Image();
sandra0.src = "image1.gif";
sandra1 = new Image();
sandra1.src = "image2.gif";
sandra2 = new Image();
sandra2.src = "image3.gif";
var i_strngth=1
var i_image=0
var imageurl = new Array()
imageurl[0] ="图片名称1.gif"
imageurl[1] ="图片名称2.gif"
imageurl[2] ="图片名称3.gif"
function showimage() {
if(document.all) {
if (i_strngth <=110) {
testimage.innerHTML="<img style='filter:alpha(opacity="+i_strngth+")' src="+imageurl[i_image]+" border=0>";
i_strngth=i_strngth+10
var timer=setTimeout("showimage()",100)
}
else {
clearTimeout(timer)
var timer=setTimeout("hideimage()",1000)
}
}
if(document.layers) {
clearTimeout(timer)
document.testimage.document.write("<img src="+imageurl[i_image]+" border=0>")
document.close()
i_image++
if (i_image >= imageurl.length) {i_image=0}
var timer=setTimeout("showimage()",2000)
}
}
function hideimage() {
if (i_strngth >=-10) {
testimage.innerHTML="<img style='filter:alpha(opacity="+i_strngth+")' src="+imageurl[i_image]+" border=0>";
i_strngth=i_strngth-10
var timer=setTimeout("hideimage()",100)
}
else {
clearTimeout(timer)
i_image++
if (i_image >= imageurl.length) {i_image=0}
i_strngth=1
var timer=setTimeout("showimage()",500)
}
}
//-->
</script>

====2、修改<body>语句为：

<body onLoad="showimage()">

====3、将下面的代码加入到HEML的<body></body>之间：

<div id="testimage" style="position:absolute;visibility:visible;top:120px;left:240px"></div>

※ 效果演示 ※


特效

将图片图片固定在页面左上角[根据说明修改即可共1步]

====1、将以下代码加入到HEML的<body></body>之间

<SCRIPT language=JavaScript>
<!-- Hide the script from old browsers --
// 1) 做一个88*31的LOGO。
if (document.images)
var staticlogo=new Image(88,31)
// 2) 设置LOGO的路径。
staticlogo.src="图片的名称1.gif"
// 3) 以下是LOGO代表的连接。
var logolink="http://www.happydrips.com"
// 4) 设置ALT属性。
var alttext="快乐点滴"
// 5) 设置下列属性为 1或者0(1是IE特有的，使LOGO隐现）
var fadeintoview=1
/* 6) 最后设置LOGO显示的时间，例如12 秒，数值为0表示一直显示
*/
var visibleduration=12
/////////////////////////以下不要改变/////////////////////////
function regenerate(){
window.location.reload()
}
function regenerate2(){
if (document.layers)
setTimeout("window.onresize=regenerate",400)
}
var fadeset=''
if (fadeintoview)
fadeset="filter:alpha(opacity=0)"
if (document.all)
document.write('<span id="logo"" style="'+fadeset+';position:absolute;top:100;width:'+staticlogo.width+';height:'+staticlogo.height+'"></span>')
function bringintoview(){
if (logo.filters.alpha.opacity<=95)
logo.filters.alpha.opacity+=5
else{
clearInterval(viewit)
if (visibleduration!=0)
setTimeout("logo.style.visibility='hidden'",visibleduration*1000)
}
}
function createlogo(){
staticimage=new Layer(100)
staticimage.left=-300
staticimage.top=120
staticimage.document.write('<a href="'+logolink+'"><img src="'+staticlogo.src+'" border=0 alt="'+alttext+'"></a>')
staticimage.document.close()
staticimage.visibility="show"
regenerate2()
staticitns()
}
if (document.layers)
window.onload=createlogo;
if (document.all){
w=2
h=2
logo.style.left=w
logo.style.top=h
}
function logoit(){
var w2=document.body.scrollLeft+w
var h2=document.body.scrollTop+h
logo.style.left=w2
logo.style.top=h2
}
function logoit2(){
staticimage.left=pageXOffset+2
staticimage.top=pageYOffset+2
}
function insertimage(){
logo.innerHTML='<a href="'+logolink+'"><img src="'+staticlogo.src+'" border=0 alt="'+alttext+'"></a>'
if (fadeintoview)
viewit=setInterval("bringintoview()",100)
else{
if (visibleduration!=0)
setTimeout("logo.style.visibility='hidden'",visibleduration*1000)
}
}
if (document.all){
window.onscroll=logoit
window.onresize=new Function("window.location.reload()")
window.onload=insertimage
}
function staticitns(){
setInterval("logoit2()",90)
if (visibleduration!=0)
setTimeout("staticimage.visibility='hide'",visibleduration*1000)
}
//-->
</SCRIPT>

※ 效果演示 ※


New Page 1

谢谢使用本软件！

请继续关注和支持本站！


特效

左右移动的图片[修改图片名称即可][共2步]

====1、将以下代码加入到HEML的<head></head>之间：

<script LANGUAGE="JavaScript"><!--
step = 0;
obj = new Image();
function anim(xp,xk,smer) //smer = direction
{
obj.style.left = x;
x += step*smer;
if (x>=(xk+xp)/2) {
if (smer == 1) step--;
else step++;
}
else {
if (smer == 1) step++;
else step--;
}
if (x >= xk) {
x = xk;
smer = -1;
}
if (x <= xp) {
x = xp;
smer = 1;
}
// if (smer > 2) smer = 3;
setTimeout('anim('+xp+','+xk+','+smer+')', 50);
}
function moveLR(objID,movingarea_width,c)
{
if (navigator.appName=="Netscape") window_width = window.innerWidth;
else window_width = document.body.offsetWidth;
obj = document.images[objID];
image_width = obj.width;
x1 = obj.style.left;
x = Number(x1.substring(0,x1.length-2)); // 30px -> 30
if (c == 0) {
if (movingarea_width == 0) {
right_margin = window_width - image_width;
anim(x,right_margin,1);
}
else {
right_margin = x + movingarea_width - image_width;
if (movingarea_width < x + image_width) window.alert("No space for moving!");
else anim(x,right_margin,1);
}
}
else {
if (movingarea_width == 0) right_margin = window_width - image_width;
else {
x = Math.round((window_width-movingarea_width)/2);
right_margin = Math.round((window_width+movingarea_width)/2)-image_width;
}
anim(x,right_margin,1);
}
}
//--></script>

====2、将以下代码加入到HEML的<body></body>之间：

<img src="要显示的图片名称.gif" name="picture"
style="position: absolute; top: 70px; left: 30px;" BORDER="0" WIDTH="140" HEIGHT="40">
<script LANGUAGE="JavaScript"><!--
setTimeout("moveLR('picture',300,1)",10);
//--></script>

※ 效果演示 ※


特效

图象滚动公告版[适合做图片的滚动友情链接][很有用][共1步]

====1、将以下代码加入到HEML的<body></body>之间：

<script language="JavaScript1.2">
<!--
/*设置下面的参数。 设置scrollerwidth和scrollerheight参数，设置成滚动显示的图片中尺寸最大的。*/
var scrollerwidth=140
var scrollerheight=40
var scrollerbgcolor='white'
//每个图间暂停3秒。
var pausebetweenimages=3000
//边界下面的行，如果希望logo都是带连接的，只要加上<a>标签即可。
var slideimages=new Array()
slideimages[0]='<a href="index.htm"><img src="第一张图片.gif" border=0"></a>'
slideimages[1]='<a href="index1.htm"><img src="第二张图片.gif"></a>'
slideimages[2]='<a href="index2.htm"><img src="第三张图片.gif"></a>'
slideimages[3]='<a href="index3.htm"><img src="第四张图片.gif"></a>'
//尽管填加更多的。
//////以下不要修改////////////////
if (slideimages.length>1)
i=2
else
i=0
function move1(whichlayer){
tlayer=eval(whichlayer)
if (tlayer.top>0&&tlayer.top<=5){
tlayer.top=0
setTimeout("move1(tlayer)",pausebetweenimages)
setTimeout("move2(document.main.document.second)",pausebetweenimages)
return
}
if (tlayer.top>=tlayer.document.height*-1){
tlayer.top-=5
setTimeout("move1(tlayer)",100)
}
else{
tlayer.top=scrollerheight
tlayer.document.write(slideimages[i])
tlayer.document.close()
if (i==slideimages.length-1)
i=0
else
i++
}}
function move2(whichlayer){
tlayer2=eval(whichlayer)
if (tlayer2.top>0&&tlayer2.top<=5){
tlayer2.top=0
setTimeout("move2(tlayer2)",pausebetweenimages)
setTimeout("move1(document.main.document.first)",pausebetweenimages)
return
}
if (tlayer2.top>=tlayer2.document.height*-1){
tlayer2.top-=5
setTimeout("move2(tlayer2)",100)
}
else{
tlayer2.top=scrollerheight
tlayer2.document.write(slideimages[i])
tlayer2.document.close()
if (i==slideimages.length-1)
i=0
else
i++
}}
function move3(whichdiv){
tdiv=eval(whichdiv)
if (tdiv.style.pixelTop>0&&tdiv.style.pixelTop<=5){
tdiv.style.pixelTop=0
setTimeout("move3(tdiv)",pausebetweenimages)
setTimeout("move4(second2)",pausebetweenimages)
return
}
if (tdiv.style.pixelTop>=tdiv.offsetHeight*-1){
tdiv.style.pixelTop-=5
setTimeout("move3(tdiv)",100)
}
else{
tdiv.style.pixelTop=scrollerheight
tdiv.innerHTML=slideimages[i]
if (i==slideimages.length-1)
i=0
else
i++
}
}
function move4(whichdiv){
tdiv2=eval(whichdiv)
if (tdiv2.style.pixelTop>0&&tdiv2.style.pixelTop<=5){
tdiv2.style.pixelTop=0
setTimeout("move4(tdiv2)",pausebetweenimages)
setTimeout("move3(first2)",pausebetweenimages)
return
}
if (tdiv2.style.pixelTop>=tdiv2.offsetHeight*-1){
tdiv2.style.pixelTop-=5
setTimeout("move4(second2)",100)
}
else{
tdiv2.style.pixelTop=scrollerheight
tdiv2.innerHTML=slideimages[i]
if (i==slideimages.length-1)
i=0
else
i++
}}
function startscroll(){
if (document.all){
move3(first2)
second2.style.top=scrollerheight
}
else if (document.layers){
move1(document.main.document.first)
document.main.document.second.top=scrollerheight+5
document.main.document.second.visibility='show'
}}
window.onload=startscroll
//-->
</script> <ilayer id="main" width="&amp;{scrollerwidth};" height="&amp;{scrollerheight};" bgcolor="&amp;{scrollerbgcolor};"> <layer id="first" left="0" top="1" width="&amp;{scrollerwidth};"> <script
language="JavaScript1.2">
if (document.layers)
document.write(slideimages[0])
</script> </layer> <layer id="second" left="0" top="0" width="&amp;{scrollerwidth};" visibility="hide"> <script language="JavaScript1.2">
if (document.layers)
document.write(slideimages[1])
</script> </layer> </ilayer> </p>
<p><script language="JavaScript1.2">
<!--
if (document.all){
document.writeln('<span id="main2" style="position:relative;width:'+scrollerwidth+';height:'+scrollerheight+';overflow:hiden;background-color:'+scrollerbgcolor+'">')
document.writeln('<div style="position:absolute;width:'+scrollerwidth+';height:'+scrollerheight+';clip:rect(0 '+scrollerwidth+' '+scrollerheight+' 0);left:0;top:0">')
document.writeln('<div id="first2" style="position:absolute;width:'+scrollerwidth+';left:0;top:1;">')
document.write(slideimages[0])
document.writeln('</div>')
document.writeln('<div id="second2" style="position:absolute;width:'+scrollerwidth+';left:0;top:0">')
document.write(slideimages[1])
document.writeln('</div>')
document.writeln('</div>')
document.writeln('</span>')
}
//--></script>

※ 效果演示 ※


特效

跟随屏幕移动的图像[推荐]修改图片名称和文字即可][共2步]

====1、将以下代码加入到HEML的<head></head>之间：

<style type="text/css">
#floater {
position: absolute;
left: 500;
top: 146;
width: 125;
visibility: visible;
z-index: 10;
}</style>

====2、将以下代码加入到HEML的<body></body>之间

<div ID="floater" style="left: 590px; top: 158px">
<p align="center"><img SRC="想要显示的图片.gif" alt="图片显示的文字" WIDTH="125" HEIGHT="60"><br>
<font color="#FF8040">图片下面的文字</font></p>
</div><script LANGUAGE="JavaScript">
self.onError=null;
currentX = currentY = 0;
whichIt = null;
lastScrollX = 0; lastScrollY = 0;
NS = (document.layers) ? 1 : 0;
IE = (document.all) ? 1: 0;
<!-- STALKER CODE -->
function heartBeat() {
if(IE) { diffY = document.body.scrollTop; diffX = document.body.scrollLeft; }
if(NS) { diffY = self.pageYOffset; diffX = self.pageXOffset; }
if(diffY != lastScrollY) {
percent = .1 * (diffY - lastScrollY);
if(percent > 0) percent = Math.ceil(percent);
else percent = Math.floor(percent);
if(IE) document.all.floater.style.pixelTop += percent;
if(NS) document.floater.top += percent;
lastScrollY = lastScrollY + percent;
}
if(diffX != lastScrollX) {
percent = .1 * (diffX - lastScrollX);
if(percent > 0) percent = Math.ceil(percent);
else percent = Math.floor(percent);
if(IE) document.all.floater.style.pixelLeft += percent;
if(NS) document.floater.left += percent;
lastScrollX = lastScrollX + percent;
}
}
<!-- /STALKER CODE -->
<!-- DRAG DROP CODE -->
function checkFocus(x,y) {
stalkerx = document.floater.pageX;
stalkery = document.floater.pageY;
stalkerwidth = document.floater.clip.width;
stalkerheight = document.floater.clip.height;
if( (x > stalkerx && x < (stalkerx+stalkerwidth)) && (y > stalkery && y < (stalkery+stalkerheight))) return true;
else return false;
}
function grabIt(e) {
if(IE) {
whichIt = event.srcElement;
while (whichIt.id.indexOf("floater") == -1) {
whichIt = whichIt.parentElement;
if (whichIt == null) { return true; }
}
whichIt.style.pixelLeft = whichIt.offsetLeft;
whichIt.style.pixelTop = whichIt.offsetTop;
currentX = (event.clientX + document.body.scrollLeft);
currentY = (event.clientY + document.body.scrollTop);
} else {
window.captureEvents(Event.MOUSEMOVE);
if(checkFocus (e.pageX,e.pageY)) {
whichIt = document.floater;
StalkerTouchedX = e.pageX-document.floater.pageX;
StalkerTouchedY = e.pageY-document.floater.pageY;
}
}
return true;
}
function moveIt(e) {
if (whichIt == null) { return false; }
if(IE) {
newX = (event.clientX + document.body.scrollLeft);
newY = (event.clientY + document.body.scrollTop);
distanceX = (newX - currentX); distanceY = (newY - currentY);
currentX = newX; currentY = newY;
whichIt.style.pixelLeft += distanceX;
whichIt.style.pixelTop += distanceY;
if(whichIt.style.pixelTop < document.body.scrollTop) whichIt.style.pixelTop = document.body.scrollTop;
if(whichIt.style.pixelLeft < document.body.scrollLeft) whichIt.style.pixelLeft = document.body.scrollLeft;
if(whichIt.style.pixelLeft > document.body.offsetWidth - document.body.scrollLeft - whichIt.style.pixelWidth - 20) whichIt.style.pixelLeft = document.body.offsetWidth - whichIt.style.pixelWidth - 20;
if(whichIt.style.pixelTop > document.body.offsetHeight + document.body.scrollTop - whichIt.style.pixelHeight - 5) whichIt.style.pixelTop = document.body.offsetHeight + document.body.scrollTop - whichIt.style.pixelHeight - 5;
event.returnValue = false;
} else {
whichIt.moveTo(e.pageX-StalkerTouchedX,e.pageY-StalkerTouchedY);
if(whichIt.left < 0+self.pageXOffset) whichIt.left = 0+self.pageXOffset;
if(whichIt.top < 0+self.pageYOffset) whichIt.top = 0+self.pageYOffset;
if( (whichIt.left + whichIt.clip.width) >= (window.innerWidth+self.pageXOffset-17)) whichIt.left = ((window.innerWidth+self.pageXOffset)-whichIt.clip.width)-17;
if( (whichIt.top + whichIt.clip.height) >= (window.innerHeight+self.pageYOffset-17)) whichIt.top = ((window.innerHeight+self.pageYOffset)-whichIt.clip.height)-17;
return false;
}
return false;
}
function dropIt() {
whichIt = null;
if(NS) window.releaseEvents (Event.MOUSEMOVE);
return true;
}
<!-- DRAG DROP CODE -->
if(NS) {
window.captureEvents(Event.MOUSEUP|Event.MOUSEDOWN);
window.onmousedown = grabIt;
window.onmousemove = moveIt;
window.onmouseup = dropIt;
}
if(IE) {
document.onmousedown = grabIt;
document.onmousemove = moveIt;
document.onmouseup = dropIt;
}
if(NS || IE) action = window.setInterval("heartBeat()",1);
</script>

※ 效果演示 ※


New Page 1

欢迎光临 点滴奉献


特效

左键弹出式菜单[推荐][修改显示的文字及链接即可][共2步]

====1、将以下代码加入HEML的<head></head>之间：

<style type="text/css">
body{font: 9pt "宋体"; margintop: 0px ; color: #ffffff; background: #000000}
a.{ font: 9pt "宋体"; cursor: hand; font-size: 9pt ; color: #ffffff; text-decoration: none }
a:active{ font: 9pt "宋体"; cursor: hand; color: #FF0033 }
a.cc:hover{ font: 9pt "宋体"; cursor: hand; color: #FF0033}
.box{ font: 9pt "宋体"; position: absolute; background: #000000 }
</style>

====2、将以下代码加入到HEML的<body></body>之间：

<table id="itemopen" class="box" style="display:none">
<tr>
<td>弹出菜单</td>
</tr>
<tr>
<td><a href="../../../index.html" class="cc">本站首页</a></td>
</tr>
<tr>
<td><a href="../../navigation/newscript.htm" class="cc">最新更新</a></td>
</tr>
<tr>
<td><a href="../../navigation/applet/appletindex.htm" class="cc">梦想软件</a></td>
</tr>
<tr>
<td><a href="../../../jsschool/index.htm" class="cc">桌面壁纸</a></td>
</tr>
<tr>
<td><a href="popmenu.htm" class="cc">更多连接</a></td>
</tr>
<tr>
<td><a href="popmenu.htm" class="cc">更多连接</a></td>
</tr>
<tr>
<td><a href="popmenu.htm" class="cc">更多连接</a></td>
</tr>
</table>
</center></div><!-- End of Popup Menu -->
<script language="JavaScript">
document.onclick = popUp
function popUp() {
newX = window.event.x + document.body.scrollLeft
newY = window.event.y + document.body.scrollTop
menu = document.all.itemopen
if ( menu.style.display == ""){
menu.style.display = "none" }
else {
menu.style.display = ""}
menu.style.pixelLeft = newX - 50
menu.style.pixelTop = newY - 50
}
</script>

※ 效果演示 ※


New Page 1

弹出菜单
本站首页
最新更新
梦想软件
桌面壁纸
更多连接
更多连接
更多连接


特效

推拉门式样的菜单[根据提示修改][共2步]

====1、将以下代码加入到HEML的<head></head>之间：

<style type="text/css">
<!--.link {
color : #000000;
text-decoration : none;
}A.link:hover {
color : red;
}A.link:active {
color : #000000;
text-decoration : none;
}//-->
</style>
<style type="text/css">
<!--
#slidemenubar2{position:absolute;left:-110pt;width:120pt;top:100pt;border:1.5pt solid black;
background-color:#ffffff;layer-background-color:#ffffff;font: 9pt/20pt "宋体";}
body { font-size: 9pt; margin: 0pt}
#slidemenubar { position:absolute;
left:-110pt;width:120pt;top:100pt;border:1.5pt black solid;background-color:#F3F3F3;layer-background-color:lightyellow;
font: 9pt/20pt "宋体"; }
//-->
</style>

====2、将以下代码加入到HEML的<body></body>之间：

<script language="JavaScript1.2">
if (document.all)
document.write('<div id="slidemenubar2" style="left:-100" onMouseover="pull()" onMouseout="draw()">')
</script> <layer id="slidemenubar" onMouseover="pull()" onMouseout="draw()"> <script language="JavaScript1.2">
var sitems=new Array()
var sitemlinks=new Array()
//以下是菜单内容，自由设置；
sitems[0]="本站首页"
sitems[1]="最新更新"
sitems[2]="梦想软件"
sitems[3]="其它栏目"
sitems[4]="桌面壁纸"
sitems[5]="给我留言"
sitems[6]="下载特区"
sitems[7]="Email Me"
sitems[8]="我的简介"
//菜单项目连接
sitemlinks[0]="http://www.happydrips.com"
sitemlinks[1]="http://www.abc.com"
sitemlinks[2]="http://abc.ab.com"
sitemlinks[3]="../index.htm"
sitemlinks[4]="../jsschool/index.htm"
sitemlinks[5]="../../../gsbook.htm"
sitemlinks[6]="../../../perl/index.htm"
sitemlinks[7]="mailto:yshot@263.net"
sitemlinks[8]="http://www.happydrips.com"
for (i=0;i<=sitems.length-1;i++)
document.write('<a href='+sitemlinks[i]+'>'+sitems[i]+'</a><br>')
</script> </layer>
<script language="JavaScript1.2">
function regenerate(){
window.location.reload()
}function regenerate2(){
if (document.layers)
setTimeout("window.onresize=regenerate",400)
}window.onload=regenerate2
if (document.all){
document.write('</div>')
themenu=document.all.slidemenubar2.style
rightboundary=0
leftboundary=-150
}else{
themenu=document.layers.slidemenubar
rightboundary=150
leftboundary=10
}function pull(){
if (window.drawit)
clearInterval(drawit)
pullit=setInterval("pullengine()",50)
}function draw(){
clearInterval(pullit)
drawit=setInterval("drawengine()",50)
}function pullengine(){
if (document.all&&themenu.pixelLeft<rightboundary)
themenu.pixelLeft+=5
else if(document.layers&&themenu.left<rightboundary)
themenu.left+=5
else if (window.pullit)
clearInterval(pullit)
}function drawengine(){
if (document.all&&themenu.pixelLeft>leftboundary)
themenu.pixelLeft-=5
else if(document.layers&&themenu.left>leftboundary)
themenu.left-=5
else if (window.drawit)
clearInterval(drawit)
}</script>

※ 效果演示 ※


特效

浮动顶层的菜单1[修改图片名称及链接的地址][共2步]

====1、将以下代码加入HTML的<head></head>之间：

<SCRIPT LANGUAGE="JavaScript">
<!-- Begin
function setVariables() {
if (navigator.appName == "Netscape") {
v=".top=";
dS="document.";
sD="";
y="window.pageYOffset";
}
else {
v=".pixelTop=";
dS="";
sD=".style";
y="document.body.scrollTop";
}
}
function checkLocation() {
object="object1";
yy=eval(y);
eval(dS+object+sD+v+yy);
setTimeout("checkLocation()",10);
}
// End -->
</script>

====2、将以下代码加入HTML的<body></body>之间：

<BODY OnLoad="setVariables();checkLocation()">
<div id="object1" style="position:absolute; visibility:show; left:0px; top:0px; z-index:2">
<table width=128 border=0 cellspacing=20 cellpadding=0>
<tr>
<td height="97"><a href="地址1.htm"><img src="图片1.gif" width="105" height="21" border="0"></a><br>
<a href="地址2.htm"><img src="图片2.gif" width="105" height="21" border="0"></a><br>
<a href="地址3.htm"><img src="图片3.gif" width="105" height="21" border="0"></a><br>
<a href="地址4.htm"><img src="图片4.gif" width="105" height="21" border="0"></a>
</td>
</tr>
</table>
</div></BODY>

※ 效果演示 ※


New Page 1

源码演示


特效

浮动顶层的菜单2[修改文字及链接地址][共2步]

====1、将以下代码加入到HTML的<head></head>之间：

<script language="javascript">
<!--
function stat(){
var a = pageYOffset+window.innerHeight-document.bar.document.height-15
document.bar.top = a
setTimeout('stat()',2)
}
function fix(){
nome=navigator.appName
if(nome=='Netscape'){
stat()
}
else{
var a=document.body.scrollTop+document.body.clientHeight-document.all.bar.offsetHeight+15
bar.style.top = a
}}
//-->
</script>

====2、将以下代码加入HTML的<body></body>之间：

<body onLoad='fix()' onScroll="fix()" onResize="fix()"> //这一行不要忘记写
/*span标签内放入一个TABLE，里面就是你的站点连接菜单，用TABLE的目的是比较容易控制布局。你
可以自由修改下一行的代码，修正菜单出现的绝对位置。 */
<span id="bar" style="position:absolute; left:68px; top:455px; width:614px; height:45px; z-index:9" >
<table border="1" hspace="1" cellpadding="1" bordercolor="#000000" bgcolor="#FFFFFF">
<tr align="center">
<td width="190"> <a href="index.html">回到首页 </a></td>
<td width="147"> <a href="newscript.htm">最新更新页</a></td>
<td width="96"> <a href="http://qdjacky.126.htm">梦想软件</a></td>
<td width="158"> <a href="http://qdjacky.126.com" target="_blank">梦想软件</a>
</td>
</tr>
</table>
</span>

※ 效果演示 ※


New Page 1

回到首页 最新更新页 快乐点滴 我的软件


特效

渐显效果下拉菜单[推荐][修改显示的文字及链接][共2步][IE适用]

====1、将以下代码加入HTML的<head></head>之间：

<style>
<!--
#iewrap{
position:relative;
height:30px
}
#iewrap2{
position:absolute
}
#dropmenu03{
filter:revealTrans(Duration=1.5,Transition=12)
visibility:hide
}
a:hover { color: #FF0000}
body { font-family: "宋体"; font-size: 9pt; text-decoration: none}
a { font-family: "宋体"; font-size: 9pt; text-decoration: none}
-->
</style>

====2、将以下代码加入HTML的<body></body>之间：

<ilayer id="dropmenu01" height=35px>
<layer id="dropmenu02" visibility=show>
<span id="iewrap">
<span id="iewrap2" onClick="dropit2();event.cancelBubble=true;return false">
<font face="宋体"><a href="#">点这里看本站栏目</a></font>
</span>
</span>
</layer>
</ilayer>
<script language="JavaScript1.2">
//如果想关闭 "fade"（消隐）效果，将如下参数设置成false，适用于IE用户。
var enableeffect=true
//将如下数组修改成你自己的。
var selection=new Array()
selection[0]='<font face="宋体"><a href="link1.htm">link1</a></font><br>'
selection[1]='<font face="宋体"><a href="link2.htm">link2</a></font><br>'
selection[2]='<font face="宋体"><a href="link3.htm">link3</a></font><br>'
selection[3]='<font face="宋体"><a href="link4.htm">link4</a></font><br>'
selection[4]='<font face="宋体"><a href="link5.htm">link5</a></font>'
if (document.layers)
document.dropmenu01.document.dropmenu02.visibility='show'
function dropit2(){
if (document.all){
dropmenu03.style.left=document.body.scrollLeft+event.clientX-event.offsetX
dropmenu03.style.top=document.body.scrollTop+event.clientY-event.offsetY+18
if (dropmenu03.style.visibility=="hidden"){
if (enableeffect)
dropmenu03.filters.revealTrans.apply()
dropmenu03.style.visibility="visible"
if (enableeffect)
dropmenu03.filters.revealTrans.play()
}
else{
hidemenu()
}
}
}
function dropit(e){
if (document.dropmenu03.visibility=="hide")
document.dropmenu03.visibility="show"
else
document.dropmenu03.visibility="hide"
document.dropmenu03.left=e.pageX-e.layerX
document.dropmenu03.top=e.pageY-e.layerY+19
return false
}
function hidemenu(){
if (enableeffect)
dropmenu03.filters.revealTrans.stop()
dropmenu03.style.visibility="hidden"
}
function hidemenu2(){
document.dropmenu03.visibility="hide"
}
if (document.layers){
document.dropmenu01.document.dropmenu02.captureEvents(Event.CLICK)
document.dropmenu01.document.dropmenu02.onclick=dropit
}
else if (document.all)
document.body.onclick=hidemenu
</script>

====3、将以下代码加入HEML的<body></body>之间：[第2步的下面位置]
<!-- 你可以改变菜单出现的外观风格-->
<div id="dropmenu03" style="position:absolute;left:0;top:0;layer-background-color:seashell;background-color:seashell;width:100;visibility:hidden;border:1px solid black;padding:0px">
<script language="JavaScript1.2">
if (document.all)
dropmenu03.style.padding='4px'
for (i=0;i<selection.length;i++)
document.write(selection[i])
</script>
</div>
<script language="JavaScript1.2">
if (document.layers){
document.dropmenu03.captureEvents(Event.CLICK)
document.dropmenu03.onclick=hidemenu2
}
</script>

※ 效果演示 ※


New Page 1

 点这里看本站栏目


特效

普通下拉菜单1[修改文字及链接地址即可][共2步]

====1、将以下代码加入HTML的<body></body>之间：
<FORM name="guideform">
<SELECT name="guidelinks">
<OPTION SELECTED value="http://qdjacky.126.com">我的主页
<OPTION value="http://place.com/page2.htm">友情链接
<OPTION value="http://place.com/page3.htm">友情链接
<OPTION value="http://place.com/page4.htm">友情连接
</SELECT>

<INPUT type="button" name="go" value="Go!" onClick="window.location=document.guideform.guidelinks.options[document.guideform.guidelinks.selectedIndex].value"> </FORM>

====2、特别说明：

菜单中的内容多少不限，按照格式写即可。连接URL使用绝对URL（http://）和相对路径都可以。
在同一页面上不要同时使用这两个普通菜单的代码，当然要使用完全没有问题
只是2个FORM和SELECT的名字（Name）应该不能重复，总不能都叫做“guideform”吧？

※ 效果演示 ※


特效

普通下拉菜单2[修改文字及链接地址即可][共2步]

====1、将以下代码加入HTML的<body></body>之间：

<FORM name="guideform">
<SELECT name="guidelinks" onChange="window.location=document.guideform.guidelinks.options[document.guideform.guidelinks.selectedIndex].value">
<OPTION SELECTED value="javascript:void(0)">选择一个项目
<OPTION value="http://place.com/page1.htm">友情链接
<OPTION value="http://place.com/page2.htm">友情链接
</SELECT>
</FORM>

====2、特别说明：在同一页面上不要同时使用上面2个脚本的代码，当然要使用完全没有问题。
只是2个FORM和SELECT的名字（Name）应该不能重复，总不能都叫做“guideform”吧？

※ 效果演示 ※


特效

鼠标感应渐显图片[平时很模糊的图片鼠标一放上就显示清楚]
[修改图片名称即可][共2步]

====1、将以下代码加入HTML的<head></head>之间：

<script language="JavaScript1.2">
function makevisible(cur,which){
if (which==0)
cur.filters.alpha.opacity=100
else
cur.filters.alpha.opacity=20
}
</script>

====2、将以下代码加入到HTML的<body><body>之间：

<img src="想要显示的图片.gif" style="filter:alpha(opacity=20)" onMouseOver="makevisible(this,0)" onMouseOut="makevisible(this,1)">

※ 效果演示 ※


特效

鼠标感应-弹出警告框[修改文字即可][共1步]
[其实这个效果也没有多大用处，但在个别地方放上一个也能增色不少！^-^]

====1、将以下代码加入到HTML的<body></body>之间：

<a href onmouseover="alert('^-^哈哈上当了，其实什么都没有！')">想听笑话吗？</a>

※ 效果演示 ※


New Page 1

 想听笑话吗？


特效

跟随鼠标的*[推荐][共2步][无须修改]
[顺便告诉你并不一定非用*发挥你的想象改吧！不过好象还是*比较漂亮！]

====1、将以下代码加入到HEML的<head></head>之间：

<STYLE TYPE="text/css">
<!--
BODY{
overflow:scroll;
overflow-x:hidden;
}
.s1
{
position : absolute;
font-size : 12pt;
color : blue;
visibility: hidden;
}
.s2
{
position : absolute;
font-size : 20pt;
color : red;
visibility : hidden;
}
.s3
{
position : absolute;
font-size : 16pt;
color : gold;
visibility : hidden;
}
.s4
{
position : absolute;
font-size : 14pt;
color : lime;
visibility : hidden;
}
-->
</STYLE>

====2、将以下代码加入HTML的<body></body>之间：

<body bgcolor="#FFFFFF">
<DIV ID="div1" CLASS="s1">*</DIV>
<DIV ID="div2" CLASS="s2">*</DIV>
<DIV ID="div3" CLASS="s3">*</DIV>
<DIV ID="div4" CLASS="s4">*</DIV>
<script language="javascript" type="text/javascript" class="s5">
var nav = (document.layers);
var tmr = null;
var spd = 50;
var x = 0;
var x_offset = 5;
var y = 0;
var y_offset = 15;
if(nav) document.captureEvents(Event.MOUSEMOVE);
document.onmousemove = get_mouse;
function get_mouse(e)
{
x = (nav) ? e.pageX : event.clientX+document.body.scrollLeft;
y = (nav) ? e.pageY : event.clientY+document.body.scrollTop;
x += x_offset;
y += y_offset;
beam(1);
}
function beam(n)
{
if(n<5)
{
if(nav)
{
eval("document.div"+n+".top="+y);
eval("document.div"+n+".left="+x);
eval("document.div"+n+".visibility='visible'");
}
else
{
eval("div"+n+".style.top="+y);
eval("div"+n+".style.left="+x);
eval("div"+n+".style.visibility='visible'");
}
n++;
tmr=setTimeout("beam("+n+")",spd);
}
else
{
clearTimeout(tmr);
fade(4);
}
}
function fade(n)
{
if(n>0)
{
if(nav)eval("document.div"+n+".visibility='hidden'");
else eval("div"+n+".style.visibility='hidden'");
n--;
tmr=setTimeout("fade("+n+")",spd);
}
else clearTimeout(tmr);
}
// -->
</script>
</body>

※ 效果演示 ※


New Page 1

*
*
*
*


特效

跟随鼠标的文字[修改显示的文字及颜色代码即可][共1步]

====1、将以下代码加入HTML的<body></body>之间

<style type="text/css">
.spanstyle {
position:absolute;
visibility:visible;
top:-50px;
font-size:9pt;
color: #000000;
font-weight:bold;
}</style>
<script>
var x,y
var step=20
var flag=0
var message="javascript源码大全。"
message=message.split("")
var xpos=new Array()
for (i=0;i<=message.length-1;i++) {
xpos[i]=-50}
var ypos=new Array()
for (i=0;i<=message.length-1;i++) {
ypos[i]=-50}
function handlerMM(e){
x = (document.layers) ? e.pageX : document.body.scrollLeft+event.clientX
y = (document.layers) ? e.pageY : document.body.scrollTop+event.clientY
flag=1}
function makesnake() {
if (flag==1 && document.all) {
for (i=message.length-1; i>=1; i--) {
xpos[i]=xpos[i-1]+step
ypos[i]=ypos[i-1] }
xpos[0]=x+step
ypos[0]=y
for (i=0; i<message.length-1; i++) {
var thisspan = eval("span"+(i)+".style")
thisspan.posLeft=xpos[i]
thisspan.posTop=ypos[i] } }
else if (flag==1 && document.layers) {
for (i=message.length-1; i>=1; i--) {
xpos[i]=xpos[i-1]+step
ypos[i]=ypos[i-1] }
xpos[0]=x+step
ypos[0]=y
for (i=0; i<message.length-1; i++) {
var thisspan = eval("document.span"+i)
thisspan.left=xpos[i]
thisspan.top=ypos[i]} }
var timer=setTimeout("makesnake()",30)}
</script>
<body onLoad="makesnake()" >
<script>
for (i=0;i<=message.length-1;i++) {
document.write("<span id='span"+i+"'class='spanstyle'>")
document.write(message[i])
document.write("</span>")}
if (document.layers){
document.captureEvents(Event.MOUSEMOVE);}
document.onmousemove = handlerMM;
</script>

※ 效果演示 ※


特效

跟随鼠标的图片[修改图片名称及路径共2步]

====1、将以下的代码加入到HEML的<head></head>之间：

<!-- 以下代码是设定smile的代码 -->
<script LANGUAGE="JavaScript">
var newtop=0
var newleft=0
if (navigator.appName == "Netscape") {
layerStyleRef="layer.";
layerRef="document.layers";
styleSwitch="";
}
else
{
layerStyleRef="layer.style.";
layerRef="document.all";
styleSwitch=".style";
}
function doMouseMove() {
layerName = 'iit'
eval('var curElement='+layerRef+'["'+layerName+'"]')
eval(layerRef+'["'+layerName+'"]'+styleSwitch+'.visibility="hidden"')
eval('curElement'+styleSwitch+'.visibility="visible"')
eval('newleft=document.body.clientWidth-curElement'+styleSwitch+'.pixelWidth')
eval('newtop=document.body.clientHeight-curElement'+styleSwitch+'.pixelHeight')
eval('height=curElement'+styleSwitch+'.height')
eval('width=curElement'+styleSwitch+'.width')
width=parseInt(width)
height=parseInt(height)
if (event.clientX > (document.body.clientWidth - 5 - width))
{
newleft=document.body.clientWidth + document.body.scrollLeft - 5 - width
}
else
{
newleft=document.body.scrollLeft + event.clientX
}
eval('curElement'+styleSwitch+'.pixelLeft=newleft')
if (event.clientY > (document.body.clientHeight - 5 - height))
{
newtop=document.body.clientHeight + document.body.scrollTop - 5 - height
}
else
{
newtop=document.body.scrollTop + event.clientY
}
eval('curElement'+styleSwitch+'.pixelTop=newtop')
}
document.onmousemove = doMouseMove;
</script>

====2、将以下代码加入到HEML的<body></body>之间：

<!-- 以下代码是设定此页的鼠标样式代码 -->
<script language="javascript">
if (navigator.appName == "Netscape") {
}
else
{
document.write('<div ID=OuterDiv>')
document.write('<img ID=iit src="想要显示的图片.gif" STYLE="position:absolute;TOP:5pt;LEFT:5pt;Z-INDEX:10;visibility:hidden;">')
document.write('</div>')
}
</script>

※ 效果演示 ※


特效

跟随鼠标的萤火虫[无须修改][]共1步]

====1、将以下代码加入HEML的<body></body>之间：

<script language="JavaScript">
if (!document.layers&&!document.all)
event="test"
function showtip2(current,e,text){
if (document.all&&document.readyState=="complete"){
document.all.tooltip2.innerHTML='<marquee style="border:1px solid black">'+text+'</marquee>'
document.all.tooltip2.style.pixelLeft=event.clientX+document.body.scrollLeft+10
document.all.tooltip2.style.pixelTop=event.clientY+document.body.scrollTop+10
document.all.tooltip2.style.visibility="visible"}
else if (document.layers){
document.tooltip2.document.nstip.document.write('<b>'+text+'</b>')
document.tooltip2.document.nstip.document.close()
document.tooltip2.document.nstip.left=0
currentscroll=setInterval("scrolltip()",100)
document.tooltip2.left=e.pageX+10
document.tooltip2.top=e.pageY+10
document.tooltip2.visibility="show"}}
function hidetip2(){
if (document.all)
document.all.tooltip2.style.visibility="hidden"
else if (document.layers){
clearInterval(currentscroll)
document.tooltip2.visibility="hidden"}}
function scrolltip(){
if (document.tooltip2.document.nstip.left>=-document.tooltip2.document.nstip.document.width)
document.tooltip2.document.nstip.left-=5
else
document.tooltip2.document.nstip.left=150}
</script>
<script language="JavaScript">
function YY_Layerfx(yyleft,yytop,yyfnx,yyfny,yydiv,yybilder,yyloop,yyto,yycnt,yystep) { //v1.2
if ((document.layers)||(document.all)){
with (Math) {yynextx= eval(yyfnx)}
with (Math) {yynexty= eval(yyfny)}
yycnt=(yyloop && yycnt>=yystep*yybilder)?0:yycnt+yystep;
if (document.layers){
eval(yydiv+".top="+(yynexty+yytop))
eval(yydiv+".left="+(yynextx+yyleft)) }
if (document.all){
eval("yydiv=yydiv.replace(/.layers/gi, '.all')");
eval(yydiv+".style.pixelTop="+(yynexty+yytop));
eval(yydiv+".style.pixelLeft="+(yynextx+yyleft)); }
argStr='YY_Layerfx('+yyleft+','+yytop+',"'+yyfnx+'","'+yyfny+'","'+yydiv+'",'+yybilder+','+yyloop+','+yyto+','+yycnt+','+yystep+')';
if (yycnt<=yystep*yybilder){eval(yydiv+".yyto=setTimeout(argStr,yyto)");} }}
function YY_Mousetrace(evnt) {
if (yyns4)
{if (evnt.pageX) {yy_ml=evnt.pageX; yy_mt=evnt.pageY;} }
else{
yy_ml=(event.clientX + document.body.scrollLeft);
yy_mt=(event.clientY + document.body.scrollTop);}
if (yy_tracescript)eval(yy_tracescript)}
</script>
<script language="JavaScript">
function PopWin()
{
var PopWin = window.open("new.htm","PopWin","toolbar=no,directries=no,scrollBars=yes,height=350,width=400");
}
</script>
<body>
<div id="tooltip2" style="position:absolute;visibility:hidden;clip:rect(0 150 50 0);width:150px;background-color:lightyellow">
<layer name="nstip" width="1000px" bgColor="lightyellow">
</layer>
</div>
<div id="yyd0"
style="position:absolute; left:10px; top:50px; width:3px; height:3px; z-index:1; background-color: #19636c; layer-background-color: #19636c; border: 1px none #000000; clip: rect(0 3 3 0)"></div><div
id="yyd1"
style="position:absolute; left:20px; top:50px; width:3px; height:3px; z-index:1; background-color: #708574; layer-background-color: #708574; border: 1px none #000000; clip: rect(0 3 3 0)"></div><div
id="yyd2"
style="position:absolute; left:30px; top:50px; width:3px; height:3px; z-index:1; background-color: #379bbf; layer-background-color: #379bbf; border: 1px none #000000; clip: rect(0 3 3 0)"></div><div
id="yyd3"
style="position:absolute; left:40px; top:50px; width:3px; height:3px; z-index:1; background-color: #25184c; layer-background-color: #25184c; border: 1px none #000000; clip: rect(0 3 3 0)"></div><div
id="yyd4"
style="position:absolute; left:50px; top:50px; width:3px; height:3px; z-index:1; background-color: #31bd3c; layer-background-color: #31bd3c; border: 1px none #000000; clip: rect(0 3 3 0)"></div><div
id="yyd5"
style="position:absolute; left:60px; top:50px; width:3px; height:3px; z-index:1; background-color: #c11efd; layer-background-color: #c11efd; border: 1px none #000000; clip: rect(0 3 3 0)"></div><script>
var yyns4=window.Event?true:false; var yy_mt = 0; var yy_ml = 0;
document.onmousemove = YY_Mousetrace;
yy_tracescript = '';
if (yyns4){ document.captureEvents(Event.mousemove);
YY_Mousetrace('',',document.YY_Mousetrace1')}
YY_Layerfx(0,0,'yy_ml+cos((15*sin(yycnt/39.83007847812662))+0)*150*(sin(10+yycnt/20)+0.2)*cos(yycnt/20)','yy_mt+sin((15*sin(yycnt/34.224861639800686))+0)*150*(sin(10+yycnt/20)+0.2)*cos(yycnt/20)','document.layers[\'yyd0\']',2000,true,80,0,1);
YY_Layerfx(0,0,'yy_ml+cos((15*sin(yycnt/27.66510707209673))+30)*150*(sin(10+yycnt/20)+0.2)*cos(yycnt/20)','yy_mt+sin((15*sin(yycnt/9.240632767417667))+30)*150*(sin(10+yycnt/20)+0.2)*cos(yycnt/20)','document.layers[\'yyd1\']',2000,true,80,0,1);
YY_Layerfx(0,0,'yy_ml+cos((15*sin(yycnt/16.45318944579641))+60)*150*(sin(10+yycnt/20)+0.2)*cos(yycnt/20)','yy_mt+sin((15*sin(yycnt/16.0564452288292))+60)*150*(sin(10+yycnt/20)+0.2)*cos(yycnt/20)','document.layers[\'yyd2\']',2000,true,80,0,1);
YY_Layerfx(0,0,'yy_ml+cos((15*sin(yycnt/6.95348954836835))+90)*150*(sin(10+yycnt/20)+0.2)*cos(yycnt/20)','yy_mt+sin((15*sin(yycnt/44.13697049887155))+90)*150*(sin(10+yycnt/20)+0.2)*cos(yycnt/20)','document.layers[\'yyd3\']',2000,true,80,0,1);
YY_Layerfx(0,0,'yy_ml+cos((15*sin(yycnt/33.90077294583733))+120)*150*(sin(10+yycnt/20)+0.2)*cos(yycnt/20)','yy_mt+sin((15*sin(yycnt/2.2378828869411587))+120)*150*(sin(10+yycnt/20)+0.2)*cos(yycnt/20)','document.layers[\'yyd4\']',2000,true,80,0,1);
YY_Layerfx(0,0,'yy_ml+cos((15*sin(yycnt/37.858312521039835))+150)*150*(sin(10+yycnt/20)+0.2)*cos(yycnt/20)','yy_mt+sin((15*sin(yycnt/18.083839795990098))+150)*150*(sin(10+yycnt/20)+0.2)*cos(yycnt/20)','document.layers[\'yyd5\']',2000,true,80,0,1);
</script>
</body>

※ 效果演示 ※


特效

背景时钟[好大的钟][推荐][共1步]

====1、以下是这个效果的全部代码。[最好从一个空页面开始]

<html>
<head>
<TITLE>背景时钟</TITLE>
<script language=javaScript>
<!--//
function clockon() {
thistime= new Date()
var hours=thistime.getHours()
var minutes=thistime.getMinutes()
var seconds=thistime.getSeconds()
if (eval(hours) <10) {hours="0"+hours}
if (eval(minutes) < 10) {minutes="0"+minutes}
if (seconds < 10) {seconds="0"+seconds}
thistime = hours+":"+minutes+":"+seconds
if(document.all) {
bgclocknoshade.innerHTML=thistime
bgclockshade.innerHTML=thistime
}
if(document.layers) {
document.bgclockshade.document.write('<div id="bgclockshade" style="position:absolute;visibility:visible;font-family:Verdana;color:FFAAAAA;font-size:120px;top:10px;left:152px">'+thistime+'</div>')
document.bgclocknoshade.document.write('<div id="bgclocknoshade" style="position:absolute;visibility:visible;font-family:Verdana;color:DDDDDD;font-size:120px;top:10px;left:150px">'+thistime+'</div>')
document.close()
}
var timer=setTimeout("clockon()",200)
}
//-->
</script>
<link rel="stylesheet" href="../style.css"></head>
<body onLoad="clockon()">
<div id="bgclockshade" style="position:absolute;visibility:visible;font-family:Arial;color:FF8888;font-size:120px;top:102px;left:152px"></div>
<div id="bgclocknoshade" style="position:absolute;visibility:visible;font-family:Arial;color:DDDDDD;font-size:120px;top:100px;left:150px"></div>
<div id="mainbody" style="position:absolute; visibility:visible">
</div>
</body>
</html>
说明：时钟显示的位置需要你修正TOP,LEFT参数来确定。TOP表示层距离显示器顶部的象素值，LEFT表示距离左侧的象素值。

※ 效果演示 ※


特效

永远居中的背景图片[推荐][共1步][修改图片名称]

====1、将以下代码加入HEML的<body></body>之间：

<STYLE TYPE="text/css">
<!--
BODY {background-image: URL(图片名称.gif);
background-position: center;
background-repeat: no-repeat;
background-attachment: fixed;}
-->
</STYLE>

※ 效果演示 ※


特效

随机显示的背景图片[想别人每次看你页面时背景都不一样吗？][共1步]

====1、将以下代码加入HTML的<head></head>之间：

<script LANGUAGE="JavaScript">
bg = new Array(2); //设定图片数量，如果图片数为3，这个参数就设为2，依次类推
bg[0] = 'bg1.gif' //显示的图片路径，可用http://
bg[1] = 'bg2.gif'
bg[2] = 'bg3.gif'
index = Math.floor(Math.random() * bg.length);
document.write("<BODY BACKGROUND="+bg[index]+">");
</script>

※ 效果演示 ※


New Page 1

源 码 演 示

(按F5或刷新页面可以看到不同的背景)


特效

不停变换的背景颜色[共1步]

====1、将以下代码加入HTML的<body></body>之间：

<body bgColor="#ffffff" onload="chgCol(); pingpong();">
<script language="JavaScript">
<!-- Hide from JavaScript-Impaired Browsers
var pos = 10;
function initArray() {
this.length = initArray.arguments.length;
for (var i = 0; i < this.length; i++) {
this[i] = initArray.arguments[i];
}
}
var col=new initArray("4b","5b","8b","8b");
col[0] = "yellow";
col[1] = "coral";
col[2] = "orange";
col[3] = "red";
col[4] = "greenyellow";
col[5] = "lime";
col[6] = "turquoise";
col[7] = "coral";
col[8] = "blueviolet";
col[9] = "violet";
function chgCol() {
pos++;
if (pos<0||pos>9) {
pos = 0;
}
document.bgColor = col[pos];
setTimeout("chgCol()",5000);
/* Change above set to every 10 seconds (1000 = 1 sec) If
you wish to speed it up, lower the number. To slow it
down, raise the number. */
}
var yourwords = "不斷變化背景色彩";var buffer1=" ";var buffer2=" ";var message1=buffer1+yourwords+buffer2;var dir = "left";var speed =150;function pingpong(){if (dir == "left") { message2=message1.substring(2,message1.length)+" "; window.status=message2; setTimeout("pingpong();",speed); message1=message2; if (message1.substring(0,1) == "*") dir="right"; }else { message2=" "+message1.substring(0,message1.length-2); window.status=message2; setTimeout("pingpong();",speed); message1=message2; if (message1.substring(message1.length-1,message1.length) == "*") dir="left"; }}// --></script>

※ 效果演示 ※


New Page 1

请等待几秒钟就可看到背景颜色的变化


特效

背景颜色自己选[推荐][共1步]

====1、以下是这个效果的全部代码。[最好从一个空页面开始]

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb_2312-80">
<title>新页面 </title>
</head>
<body>
<script language="JavaScript">
<!--
done = 0;
step = 4
function anim(yp,yk)
{
if(document.layers) document.layers["napis"].top=yp;
else document.all["napis"].style.top=yp;
if(yp>yk) step = -4
if(yp<60) step = 4
setTimeout('anim('+(yp+step)+','+yk+')', 35);
}
function start()
{
if(done) return
done = 1;
if(navigator.appName=="Netscape") {
document.napis.left=innerWidth/2 - 145;
anim(60,innerHeight - 60)
}
else {
napis.style.left=11;
anim(60,document.body.offsetHeight - 60)
}
}
//-->
</script>
<div id="napis"
style="position: absolute;top: -50;
color: #000000;font-family:宋体;font-size:9pt;">
</div><script language="JavaScript">
<!--
setTimeout('start()',10);
//-->
</script>
<script language="JavaScript">
<!-- Begin
function initArray() {
for (var i = 0; i < initArray.arguments.length; i++) {
this[i] = initArray.arguments[i];
}
this.length = initArray.arguments.length;
}
var colors = new initArray(
"#000000","#0000FF","#80FFFF","#80FF80","#FFFF00","#FF8000","#FF00FF","#FF0000"
);
delay = 100
link = 0;
vlink = 0;
function linkDance() {
link = (link+1)%colors.length;
vlink = (vlink+1)%colors.length;
document.linkColor = colors[link];
document.vlinkColor = colors[vlink];
setTimeout("linkDance()",delay);
}
linkDance();
// End -->
</script>
<script>
function colors(c1){
this.c1 = c1;
}
a00 = new colors("FFFBD0");
a01 = new colors("FF0000");
a02 = new colors("FF8080");
a03 = new colors("FF8000");
a04 = new colors("FFFF00");
a05 = new colors("000080");
a06 = new colors("0000FF");
a07 = new colors("008000");
a08 = new colors("00FF00");
a09 = new colors("804000");
a10 = new colors("808000");
a11 = new colors("000000");
a12 = new colors("FFFFFF");
a13 = new colors("C0C0C0");
a14 = new colors("408080");
a15 = new colors("808080");
a16 = new colors("D2BF51");
a17 = new colors("44BBE8");
a18 = new colors("C97AB9");
a19 = new colors("A2C97A");
a20 = new colors("804000");
a21 = new colors("6AE6C4");
a22 = new colors("33A3D1");
a23 = new colors("6C9AEE");
function changebg(type){
scheme = type;
document.bgColor = scheme.c1;
timerID=setTimeout('document.bgColor = scheme.c2', document.selector.value * 10);
}
</script>
<form NAME="selector">
<p><input TYPE="button" onClick="changebg(a00)" style="background-color: rgb(255,251,208)"><input
TYPE="button" onClick="changebg(a01)" style="background-color: rgb(255,0,0)"><input
TYPE="button" onClick="changebg(a02)" style="background-color: rgb(255,128,128)"><input
TYPE="button" onClick="changebg(a03)" style="background-color: rgb(255,128,0)"><input
TYPE="button" onClick="changebg(a04)" style="background-color: rgb(255,255,0)"><input
TYPE="button" onClick="changebg(a05)" style="background-color: rgb(0,0,128)"><input
TYPE="button" onClick="changebg(a06)" style="background-color: rgb(0,0,255)"><input
TYPE="button" onClick="changebg(a07)" style="background-color: rgb(0,128,0)"><input
TYPE="button" onClick="changebg(a08)" style="background-color: rgb(0,255,0)"><input
TYPE="button" onClick="changebg(a09)" style="background-color: rgb(128,0,0)"><input
TYPE="button" onClick="changebg(a10)" style="background-color: rgb(128,128,0)"><input
TYPE="button" onClick="changebg(a11)" style="background-color: rgb(0,0,0)"><input
TYPE="button" onClick="changebg(a12)" style="background-color: rgb(255,255,255)"><input
TYPE="button" onClick="changebg(a13)" style="background-color: rgb(192,192,192)"><input
TYPE="button" onClick="changebg(a14)" style="background-color: rgb(64,128,128)"><input
TYPE="button" onClick="changebg(a15)" style="background-color: rgb(128,128,128)"><input
TYPE="button" onClick="changebg(a16)" style="background-color: rgb(210,191,81)"><input
TYPE="button" onClick="changebg(a17)" style="background-color: rgb(68,187,232)"><input
TYPE="button" onClick="changebg(a18)" style="background-color: rgb(201,122,185)"><input
TYPE="button" onClick="changebg(a19)" style="background-color: rgb(162,201,122)"><input
TYPE="button" onClick="changebg(a20)" style="background-color: rgb(106,230,196)"><input
TYPE="button" onClick="changebg(a21)" style="background-color: rgb(194,219,185)"><input
TYPE="button" onClick="changebg(a22)" style="background-color: rgb(51,163,209)"><input
TYPE="button" onClick="changebg(a23)" style="background-color: rgb(108,154,238)"> </p>
</form>
</body>
</html>

※ 效果演示 ※


特效

页面全屏显示[ALT+F4关闭][共1步][新弹出窗口并以全屏幕方式显示]

====1、将以下代码加入HTML的<body></body>之间：

<form>
<div align="center">
<input type="BUTTON" name="FullScreen" value="全屏显示" onClick="window.open(document.location, 'big', 'fullscreen=yes')">
</div>
</form>

※ 效果演示 ※


New Page 1

(提示：按Alt+F4关闭窗口)


特效

显示器检测代码[共1步][如果对方的分辨率不是800*600就出现提示文字]
[你可以改一下分辨率试一下]

====1、将以下代码加入HEML的<body></body>之间：

<script language="JavaScript1.2">
<!--
var correctwidth=800
var correctheight=600
if (screen.width!=correctwidth||screen.height!=correctheight)
document.write("本站最佳分辨率: "+correctwidth+"*"+correctheight+". 你当前的分辨率是:"+screen.width+"*"+screen.height+"。设置合适的分辨率才能取得最佳的显示效果！")
//-->
</script>

※ 效果演示 ※


New Page 1

（提示：只有当分辨率不是800x600时才会出现提示）


特效

浏览器检测后自动调相应页面转[共1步]
[自动检测是IE还是NS然后根据结果自动专到相应页面避免浏览器的不兼容导致的页面浏览异常]

====1、将以下代码加入HTML的<head></head>之间：

<SCRIPT LANGUAGE="JavaScript">
<!-- Start Code
var ver = navigator.appVersion;
if (ver.indexOf("MSIE") != -1)
{
window.location.href="IE的页面.htm"
}else
window.location.href="NS的页面.htm"
// End Code -->
</SCRIPT>

※ 无演示，请自行验证 ※


特效

检测浏览器版本信息[检测浏览器.操作系统.的简易代码][共1步]

====1、将以下代码加入HTML的<BODY>区即可:

<script>
document.write("版本 "+navigator.appVersion);
</script>

※ 效果演示 ※


特效

页面停留时间1[共2步]

====1、将以下代码加入HTML的<head></head>之间：

<SCRIPT LANGUAGE="JAVASCRIPT">
<!--
var ap_name = navigator.appName;
var ap_vinfo = navigator.appVersion;
var ap_ver = parseFloat(ap_vinfo.substring(0,ap_vinfo.indexOf('(')));
var time_start = new Date();
var clock_start = time_start.getTime();
var dl_ok=false;
function init ()
{
if(ap_name=="Netscape" && ap_ver>=3.0)
dl_ok=true;
return true;
}
function get_time_spent ()
{
var time_now = new Date();
return((time_now.getTime() - clock_start)/1000);
}
function show_secs () // show the time user spent on the side
{
var i_total_secs = Math.round(get_time_spent());
var i_secs_spent = i_total_secs % 60;
var i_mins_spent = Math.round((i_total_secs-30)/60);
var s_secs_spent = "" + ((i_secs_spent>9) ? i_secs_spent : "0" + i_secs_spent);
var s_mins_spent ="" + ((i_mins_spent>9) ? i_mins_spent : "0" + i_mins_spent);
document.fm0.time_spent.value = s_mins_spent + ":" + s_secs_spent;
window.setTimeout('show_secs()',1000);
}
// -->
</SCRIPT>

====2、将以下代码加入HTML的<body></body>之间：

<BODY onLoad="init(); window.setTimeout('show_secs()',1);">
<form name="fm0" onSubmit="0">
<font size="-1"><I><FONT COLOR="#888888">您在本网页的停留时间:</FONT></I></font><br>
<INPUT type="text" name="time_spent" size=7 onFocus="this.blur()">
</form>

※ 效果演示 ※


New Page 1

您在本网页的停留时间:


特效

页面停留时间2[离开时弹出提示框][共1步]

====1、将以下代码加入HEML的<body></body>之间：

<script LANGUAGE="Javascript">
<!-- Begin
pageOpen = new Date();
function bye() {
pageClose = new Date();
minutes = (pageClose.getMinutes() - pageOpen.getMinutes());
seconds = (pageClose.getSeconds() - pageOpen.getSeconds());
time = (seconds + (minutes * 60));
if (time == 1) {
time = (time + " second");
}
else {
time = (time + " seconds");
}
alert('您在本页停留了' + time + '.谢谢！!');
}
// End -->
</script>
<body onUnload="bye()">

※ 效果演示 ※


特效

检测浏览器类型并调用不同的背景音乐[修改MIDI文件名][共1步]

====1、将以下代码加入HTML的<body></body>之间：

<SCRIPT LANGUAGE="JavaScript">
<!-- Begin
var MSIE=navigator.userAgent.indexOf("MSIE");
var NETS=navigator.userAgent.indexOf("Netscape");
var OPER=navigator.userAgent.indexOf("Opera");
if((MSIE>-1) || (OPER>-1)) {
document.write("<BGSOUND SRC=sound.mid LOOP=INFINITE>");
} else {
document.write("<EMBED SRC=sound2.mid AUTOSTART=TRUE ");
document.write("HIDDEN=true VOLUME=100 LOOP=TRUE>");
}
// End -->
</SCRIPT>

※ 效果演示 ※


特效

将站点加入频道栏[看详细说明]

====1、加入channel的方法：使用如下连接指向你的频道文件*.cdf。

<a href="javascript:window.external.addChannel('jschannel.cdf')">

==============================================================================================
*.cdf文件的内容如下，自己修改以适应自己的站点情况<?XML VERSION="1.0" ENCODING="GB2312"?>
<CHANNEL HREF="http://www.happydrips.com" SELF="http://jiaonan.qd.sd.cn/abc.cdf">
<Title>快乐点滴</Title>
<Abstract>欢迎光临</Abstract>
<LOGO HREF="http://jiaonan.qd.sd.cn/logo.gif" STYLE="IMAGE"/>
</CHANNEL>

※ 效果演示（无） ※


特效

将站点加入收藏[修改显示的文字、链接、名称]共1步

====1、将以下代码加入HEML的<body><body>之间

<script language="JavaScript">
function bookmarkit(){window.external.addFavorite('http://www.happydrips.com','快乐点滴')}
if (document.all)document.write('<a href="#" onClick="bookmarkit()"><strong>将本站加入收藏夹</strong></a>')
</script>

※ 效果演示 ※


特效

自动刷新页面[该代码根据自定义的时间不停的刷新页面][本例为20秒]

====1、将以下代码加入HEML的<body></body>之间：

<meta http-equiv="refresh" content="20;
url=http://www.happydrips.com">

※ 效果演示（无）※


特效

禁止查看源代码[保护您的源代码]

====1、将以下代码加入到HEML的<body></body>之间

<SCRIPT language=javascript>
function click() {if (event.button==2) {alert('不许你偷看！');}}document.onmousedown=click
</SCRIPT>

※ 效果演示 ※


New Page 1

禁止点击鼠标右键


特效

自动弹出式窗口(调用一个窗体时自动弹出一个新的窗体)
1、调整窗口大小：通过width=200,height=170控制。还可以控制是否有滚动栏等。
2、popup.location.href = '用于说明窗口内容.htm'；这一行在做什么：就是设置窗口中出现的内容的文件名

====1、将如下代码加入HTML的<head></head>之间：

<script language="JavaScript">
<!--
var gt = unescape('%3e');
var popup = null;
var over = "Launch Pop-up Navigator";
popup = window.open('', 'popupnav', 'width=200,height=170,resizable=1,scrollbars=auto');
if (popup != null) {
if (popup.opener == null) {
popup.opener = self;
}
popup.location.href = '新窗口的文件名.htm';
}
// -->
</script>

※ 效果演示（无） ※


特效

页面转换特效[由上到下的刷新效果][可将Transition=5中的数字自己调换一下看看，将会有别的效果][共1步]

====1、将以下代码加入HEML的<head></head>之间：

<head>
<meta http-equiv="Page-Enter" content="revealTrans(Duration=5.0,Transition=5)">
</head>

※ 效果演示（无） ※


特效

自动滚屏[推荐][无需修改][共1步]

====1、将以下代码加入HEMLl的<body></body>之间：

<script language="JavaScript">
var position = 0;
function scroller() {
if (position !=700 ) {
position++;
scroll(0,position);
clearTimeout(timer);
var timer = setTimeout("scroller()",50);
timer;}}
scroller() ;
</script>

※ 效果演示（无） ※


特效

中文日期[无须修改][共1步]]

====1、将以下代码加入HEML的<body></body>之间

<script LANGUAGE="JavaScript">
function number(index1){
var numberstring="一二三四五六七八九十";
if(index1 ==0) {document.write("十")}
if(index1 < 10){
document.write(numberstring.substring(0+(index1-1),index1))}
else if(index1 < 20 ){
document.write("十"+numberstring.substring(0+(index1-11),(index1-10)))}
else if(index1 < 30 ){
document.write("二十"+numberstring.substring(0+(index1-21),(index1-20)))}
else{
document.write("三十"+numberstring.substring(0+(index1-31),(index1-30)))}
}
var today1 = new Date()
var month = today1.getMonth()+1
var date = today1.getDate()
var day = today1.getDay()
document.write("<br><strong><small><center>")
document.write("公元二零零零年")
number(month)
document.write("月")
number(date)
document.write("日</small><center>")
</script>

※ 效果演示 ※


特效

现在的日期及星期[无须修改][共1步]

====1、将以下代码加入HEML的<body></body>之间

<script language=JavaScript>
today=new Date();
function initArray(){
this.length=initArray.arguments.length
for(var i=0;i<this.length;i++)
this[i+1]=initArray.arguments[i] }
var d=new initArray(
"星期日",
"星期一",
"星期二",
"星期三",
"星期四",
"星期五",
"星期六");
document.write(
"<font color=##000000 style='font-size:9pt;font-family: 宋体'> ",
today.getYear(),"年",
today.getMonth()+1,"月",
today.getDate(),"日",
d[today.getDay()+1],
"</font>" );
</script>

※ 效果演示 ※


特效

带链接的滚动字幕[修改名称及链接][共1步]

====1、将以下代码加入HEML的<body></body>之间

<script language="JavaScript1.2">
//设置marquee的宽度 (in pixels)
var marqueewidth=400
//设置marquee的高度 (in pixels, 该参数只适用于NS)
var marqueeheight=20
//设置marquee滚动的速度(数值大速度快)
var speed=4
//设置marquee显示内容，使用标准的HTML语法。
var marqueecontents='<strong><big>欢迎访问 <a href="http://www.happydrips.com">快乐点滴</a> 欢迎您光临 <a href="mailto:yshot@263.net">给我来封信！</a></big></strong></font>'
if (document.all)
document.write('<marquee scrollAmount='+speed+' style="width:'+marqueewidth+'">'+marqueecontents+'</marquee>')
function regenerate(){
window.location.reload()
}
function regenerate2(){
if (document.layers){
setTimeout("window.onresize=regenerate",450)
intializemarquee()
}
}
function intializemarquee(){
document.cmarquee01.document.cmarquee02.document.write('<nobr>'+marqueecontents+'</nobr>')
document.cmarquee01.document.cmarquee02.document.close()
thelength=document.cmarquee01.document.cmarquee02.document.width
scrollit()
}
function scrollit(){
if (document.cmarquee01.document.cmarquee02.left>=thelength*(-1)){
document.cmarquee01.document.cmarquee02.left-=speed
setTimeout("scrollit()",100)
}
else{
document.cmarquee01.document.cmarquee02.left=marqueewidth
scrollit()
}
}
window.onload=regenerate2
</script>
<ilayer width=&{marqueewidth}; height=&{marqueeheight}; name="cmarquee01">
<layer name="cmarquee02"></layer>
</ilayer>

※ 效果演示 ※


特效

垂直滚动公告板[修改显示的文字][共2步]

====1、将下列代码加入HEML的<head></head>之间：

<script>
<!--
lstart=200
loop=true
speed=350
pr_step=5
function makeObj(obj,nest){
nest=(!nest) ? '':'document.'+nest+'.'
this.css=(document.layers) ? eval(nest+'document.'+obj):eval(obj+'.style')
this.scrollHeight=document.layers?this.css.document.height:eval(obj+'.offsetHeight')
this.up=goUp
this.obj = obj + "Object"
eval(this.obj + "=this")
return this
}
function goUp(speed){
if(parseInt(this.css.top)>-this.scrollHeight){
this.css.top=parseInt(this.css.top)-pr_step
setTimeout(this.obj+".up("+speed+")",speed)

}else if(loop) {
this.css.top=lstart
eval(this.obj+".up("+speed+")")
}
}
function slideInit(){
oSlide=makeObj('divNews','divCont')
oSlide.css.top=lstart
oSlide.up(speed)
}
onload=slideInit
//-->
</script>

====2、将下列代码加入HEML的<body></body>之间：

<div id="divCont"
style="position:absolute; width:300; height:100; top:120; left:280; clip:rect(0,250,150,0)"><div
id="divNews" style="position:absolute; top:0; left:0">
<p>这是一个滚动看板<br>
但并不是大家经常看到的<br>
用<font face="Arial">java</font>实现的那种<br>
它采用<font face="Arial">javacript</font>语言和<font face="Arial">DHTML</font>的层<br>
所以你看到的原代码<br>
不需要固定在form框里或者表格里<br>
它是用的<font face="Arial">&lt;div&gt;&lt;/div&gt;</font><br>
你可以把这段代码放在<font face="Arial">HTML<br>
</font>代码里的任何地方<br>
都不会影响它出现的位置</p>
<p>这是一个用处很大的程序<br>
可以用在网页里作广告或则告示板<br>
赶快<font face="Arial">Copy</font>到你的主页里试试吧！</p>
</div></div>

※ 效果演示 ※


New Page 1

这是一个滚动看板
但并不是大家经常看到的
用java实现的那种
它采用javacript语言和DHTML的层
所以你看到的原代码
不需要固定在form框里或者表格里
它是用的<div></div>
你可以把这段代码放在HTML
代码里的任何地方
都不会影响它出现的位置

这是一个用处很大的程序
可以用在网页里作广告或则告示板
赶快Copy到你的主页里试试吧！


特效

关闭窗体[无须修改][共1步]

====1、将以下代码加入HEML的<body></body>之间：

<script language="JavaScript">
function shutwin(){
window.close();
return;}
</script>
<a href="javascript:shutwin();">关闭本窗口</a>

※ 效果演示 ※


New Page 1

 关闭本窗口


特效

十分棒的MIDI播放器[共2步](可根据相应的项目修改)

====1、将以下代码加入HTML的<head></head>之间：
<Script Language="JavaScript">
<!-- Hiding
song = new Array()
var x = 0
song[1] = "007主题曲之一"
song[2] = "007主题曲之二"
song[3] = "999朵玫瑰"
song[4] = "X-档案主题曲"
song[5] = "用心良苦"
song[6] = "泰坦尼克主题曲"
function prev(){
if (x>1)
{ x--
document.midi.typein.value=song [x]
}
}
function next(){
var max= song.length-1
if (x<max)
{ x++
document.midi.typein.value=song [x]
}
}
function go(){
if (x != 0){
location.href='song'+x+'.mid'
//以上指定播放的是当前路径的midi文件，文件名分别是song1.mid-song6.mid //
}
}
function start(){
x=1
document.midi.typein.value=song [x]
}
function end(){
x=song.length-1
document.midi.typein.value=song [x]
}
function cls(){
document.midi.typein.value="选曲"
}
// Done Hiding -->
</Script>

====2、将以下代码加入HTML的<body></body>之间区：

<BODY onload="cls()">
<FORM Name="midi">
<INPUT NAME="typein" TYPE="text" SIZE="25" ALIGN=top><BR>
<font size=3>
<INPUT TYPE=Button Value="|<<" Align=left onclick="start()">
<INPUT TYPE=Button Value="<<" Align=left onclick="prev()">
<input type=Button value="PLAY" align=left onClick="go()" name="Button">
<INPUT TYPE=Button Value=">>" Align=left onclick="next()">
<INPUT TYPE=Button Value=">>|" Align=left onclick="end()">
</font>
</FORM>

※ 效果演示 ※


特效

分时问候[修改显示的文字][共1步]

====1、将以下代码加入HTML 的<body></body>之间：

<script language="javaScript">
<!--
now = new Date(),hour = now.getHours()
if(hour < 6){document.write("凌晨好!")}
else if (hour < 9){document.write("早上好!")}
else if (hour < 12){document.write("上午好!")}
else if (hour < 14){document.write("中午好!")}
else if (hour < 17){document.write("下午好!")}
else if (hour < 19){document.write("傍晚好!")}
else if (hour < 22){document.write("晚上好!")}
else {document.write("夜里好!")}
// -->
</script>

※ 效果演示 ※


特效

密码保护页面[修改口令][共1步]

====1、将以下代码加入HEML的<body></body>之间：

<script LANGUAGE="JAVASCRIPT">
<!--
loopy()
function loopy() {
var sWord =""
while (sWord != "login") { //改为你自己的密码！
sWord = prompt("输入正确密码才能登陆!本页密码:login")
}
alert("AH...欢迎光临！")
}
//-->
</script>

※ 效果演示 ※


特效

当前的时间[无须修改][共1步]

====1、将以下代码加入HEML的<body></body>之间：
<script language=JavaScript>
var timerID = null;
var timerRunning = false;
function stopclock (){
if(timerRunning)
clearTimeout(timerID);
timerRunning = false;}
function startclock () {
stopclock();
showtime();}
function showtime () {
var now = new Date();
var hours = now.getHours();
var minutes = now.getMinutes();
var seconds = now.getSeconds()
var timeValue = "" +((hours >= 12) ? "下午 " : "上午 " )
timeValue += ((hours >12) ? hours -12 :hours)
timeValue += ((minutes < 10) ? ":0" : ":") + minutes
timeValue += ((seconds < 10) ? ":0" : ":") + seconds
document.clock.thetime.value = timeValue;
timerID = setTimeout("showtime()",1000);
timerRunning = true;}
</SCRIPT>
<body onload=startclock()>
<form name=clock >
<input name=thetime style="font-size: 9pt;color:#000000;border:0" size=12>
</form>
</body>

※ 效果演示 ※