把下面的代码加入<head>...</head>之间:
varbrOK=false;
varmie=false;
varaver=parseInt(navigator.appVersion.substring(0,1));
varaname=navigator.appName;
//checkbrowser
functioncheckbrOK()
{
if(aname.indexOf("InternetExplorer")!=-1)
{
if(aver>=4)
brOK=navigator.javaEnabled();
mie=true;
}
if(aname.indexOf("Netscape")!=-1)
{
if(aver>=4)
brOK=navigator.javaEnabled();
}
}
varvmin=5;
varvmax=2;
varvr=2;
vartimer1;
functionChip(chipname,width,height)
{
this.named=chipname;
this.vx=vmin+vmax*Math.random();
this.vy=vmin+vmax*Math.random();
this.w=width;
this.h=height;
this.xx=0;
this.yy=0;
this.timer1=null;
}
functionmovechip(chipname)
{
if(brOK)
{
eval("chip="+chipname);
if(!mie)
{
pageX=window.pageXOffset;
pageW=window.innerWidth;
pageY=window.pageYOffset;
pageH=window.innerHeight;
}
else
{
pageX=window.document.body.scrollLeft;
pageW=window.document.body.offsetWidth-8;
pageY=window.document.body.scrollTop;
pageH=window.document.body.offsetHeight;
}
chip.xx=chip.xx+chip.vx;
chip.yy=chip.yy+chip.vy;
chip.vx+=vr*(Math.random()-0.5);
chip.vy+=vr*(Math.random()-0.5);
if(chip.vx>(vmax+vmin))chip.vx=(vmax+vmin)*2-chip.vx;
if(chip.vx<(-vmax-vmin))chip.vx=(-vmax-vmin)*2-chip.vx;
if(chip.vy>(vmax+vmin))chip.vy=(vmax+vmin)*2-chip.vy;
if(chip.vy<(-vmax-vmin))chip.vy=(-vmax-vmin)*2-chip.vy;
if(chip.xx<=pageX)
{
chip.xx=pageX;
chip.vx=vmin+vmax*Math.random();
}
if(chip.xx>=pageX+pageW-chip.w)
{
chip.xx=pageX+pageW-chip.w;
chip.vx=-vmin-vmax*Math.random();
}
if(chip.yy<=pageY)
{
chip.yy=pageY;
chip.vy=vmin+vmax*Math.random();
}
if(chip.yy>=pageY+pageH-chip.h)
{
chip.yy=pageY+pageH-chip.h;
chip.vy=-vmin-vmax*Math.random();
}
if(!mie)
{
eval("document."+chip.named+".top="+chip.yy);
eval("document."+chip.named+".left="+chip.xx);
}
else
{
eval("document.all."+chip.named+".style.pixelLeft="+chip.xx);
eval("document.all."+chip.named+".style.pixelTop="+chip.yy);
}
chip.timer1=setTimeout("movechip(""+chip.named+"")",100);
}
}
functionstopme(chipname)
{
if(brOK)
{//alert(chipname)
eval("chip="+chipname);
if(chip.timer1!=null)
{
clearTimeout(chip.timer1);
}
}
}
varfloater;
functionfloater()
{
checkbrOK();
floater=newChip("floater",0,0);
if(brOK)
{
movechip("floater");
}
}
把下面的代码加入<body>...</body>之间:
<divid=floaterstyle="HEIGHT:0px; POSITION:absolute; WIDTH:0px;left:680px;top:150px;z-index:100">
<ahref=http://www.webjx.comarget=_blank>
<imgborder=0src=http://www.webjx.com/images/logo.gif></a>
</div>
这里你可以改成自己要的图片路径.