fingh 发表于 2007-4-27 10:28:38

***鼠标特效***萤火虫儿似的

把下列代码加到网页的<body></body>标签之间 从google下载我的照片管理软件
<script language="javascript">                                          
if (document.all){                                          

                                          
colours=new array('ff0000','00ff00','3366ff','ff00ff','ffa500','ffffff','fff000')                                          
                                          
amount=colours.length;                                          
ygetdelay=0,xgetdelay=0,ydelay=0,xdelay=0,step=0.2,currstep=0,my=0,mx=0;                                          
document.write('<div id="ie" style="position:absolute;top:0;left:0;"><div style="position:relative">');                                          
for (i=0; i < amount; i++)                                          
document.write('<div id="iestars" style="position:absolute;top:0px;left:0px;height:50px;width:50px;font-family:courier new;font-size:5px;color:'+colours+';padding-top:20px;text-align:center">.</div>');                                          
document.write('</div></div>');                                          
ini=1;                                          
gstep=1;                                          
function imouse(){                                          
my=event.y;mx=event.x;                                          
}                                          
document.onmousemove=imouse                                          
function dim(){                                          
ini-=gstep;                                          
dt=settimeout('dim()',10);                                          
if (ini < 2){                                          
cleartimeout(dt);                                          
glow();                                          
}                                          
}                                          
function glow(){                                          
ini+=gstep;                                          
gt=settimeout('glow()',10);                                          
if (ini > 14){                                          
cleartimeout(gt);                                          
dim();                                          
}                                          
}                                          
function stars(){                                          
ie.style.top=document.body.scrolltop;                                          
for (i=0; i < amount; i++)                                          
{                                          
var layer=iestars.style;                                             
layer.filter='glow(color='+colours+', strength='+ini+')';                                          
layer.top= ydelay+100*math.sin((5*math.sin((currstep-15.99)/10))+i*70)*math.sin((currstep)/10)*math.cos((currstep+i*25)/10);                                             
layer.left=xdelay+180*math.cos((5*math.sin((currstep-15.99)/10))+i*70)*math.sin((currstep)/10)*math.cos((currstep+i*25)/10);                                          
}                                          
currstep+=step;                                          
}                                          
function delay(){                                          
ydelay = ygetdelay+=(my-ygetdelay)*1/20;                                          
xdelay = xgetdelay+=(mx-xgetdelay)*1/20;                                          
stars();                                          
settimeout('delay()',10);                                          
}                                          
delay();                                          
glow();                                          
}                                          
</script>
      










--------------------------------------

http://www.huoyue.com.cn 活跃网,活跃人群的论坛,访问活跃网,将给您带来意想不到的收获,还可以免费为您开论坛,让您免费拥有与朋友、网友交流的论坛。你是年轻人吗?你活跃你就上!
页: [1]
查看完整版本: ***鼠标特效***萤火虫儿似的